Rename Platform -> EPlatform
This commit is contained in:
+3
-3
@@ -19,7 +19,7 @@
|
||||
|
||||
package com.seibel.distanthorizons.core.config.gui;
|
||||
|
||||
import com.seibel.distanthorizons.core.jar.Platform;
|
||||
import com.seibel.distanthorizons.core.jar.EPlatform;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.lwjgl.system.jawt.JAWT;
|
||||
import org.lwjgl.system.macosx.*;
|
||||
@@ -73,7 +73,7 @@ public final class EmbeddedFrameUtil
|
||||
|
||||
private static String getEmbeddedFrameImpl()
|
||||
{
|
||||
switch (Platform.get())
|
||||
switch (EPlatform.get())
|
||||
{
|
||||
case LINUX:
|
||||
return "sun.awt.X11.XEmbeddedFrame";
|
||||
@@ -88,7 +88,7 @@ public final class EmbeddedFrameUtil
|
||||
|
||||
private static long getEmbeddedFrameHandle(long window)
|
||||
{
|
||||
switch (Platform.get())
|
||||
switch (EPlatform.get())
|
||||
{
|
||||
case LINUX:
|
||||
return glfwGetX11Window(window);
|
||||
|
||||
@@ -40,7 +40,7 @@ public class DarkModeDetector
|
||||
|
||||
public static boolean isDarkMode()
|
||||
{
|
||||
switch (Platform.get())
|
||||
switch (EPlatform.get())
|
||||
{
|
||||
case WINDOWS:
|
||||
return isWindowsDarkMode();
|
||||
|
||||
+10
-10
@@ -20,12 +20,12 @@
|
||||
package com.seibel.distanthorizons.core.jar;
|
||||
|
||||
/**
|
||||
* A simple OS getting util based off LWJGL's Platform at {@link org.lwjgl.system.Platform}. <br>
|
||||
* A simple OS getting util based off LWJGL's EPlatform at {@link org.lwjgl.system.Platform}. <br>
|
||||
* This version includes some extra utils that we need and removes stuff which we don't.
|
||||
*
|
||||
* @author coolGi
|
||||
*/
|
||||
public enum Platform
|
||||
public enum EPlatform
|
||||
{
|
||||
WINDOWS("Windows", false),
|
||||
LINUX("Linux", true),
|
||||
@@ -33,14 +33,14 @@ public enum Platform
|
||||
BSD("BSD", true),
|
||||
UNIX("Unix", true);
|
||||
|
||||
public enum Architecture
|
||||
public enum EArchitecture
|
||||
{
|
||||
X86(false),
|
||||
X64(true),
|
||||
ARM32(false),
|
||||
ARM64(true);
|
||||
|
||||
static final Architecture current;
|
||||
static final EArchitecture current;
|
||||
final boolean is64Bit;
|
||||
|
||||
static
|
||||
@@ -53,13 +53,13 @@ public enum Platform
|
||||
: (is64Bit ? X64 : X86);
|
||||
}
|
||||
|
||||
Architecture(boolean is64Bit)
|
||||
EArchitecture(boolean is64Bit)
|
||||
{
|
||||
this.is64Bit = is64Bit;
|
||||
}
|
||||
}
|
||||
|
||||
private static final Platform current;
|
||||
private static final EPlatform current;
|
||||
|
||||
static
|
||||
{
|
||||
@@ -96,7 +96,7 @@ public enum Platform
|
||||
private final String name;
|
||||
private final boolean isUnix;
|
||||
|
||||
Platform(String name, boolean isUnix)
|
||||
EPlatform(String name, boolean isUnix)
|
||||
{
|
||||
this.name = name;
|
||||
this.isUnix = isUnix;
|
||||
@@ -115,15 +115,15 @@ public enum Platform
|
||||
}
|
||||
|
||||
/** Returns the platform on which the library is running. */
|
||||
public static Platform get()
|
||||
public static EPlatform get()
|
||||
{
|
||||
return current;
|
||||
}
|
||||
|
||||
/** Returns the architecture on which the library is running. */
|
||||
public static Architecture getArchitecture()
|
||||
public static EArchitecture getArchitecture()
|
||||
{
|
||||
return Architecture.current;
|
||||
return EArchitecture.current;
|
||||
}
|
||||
|
||||
|
||||
@@ -251,7 +251,7 @@ public class JarMain
|
||||
|
||||
// Stuff for setting the file install path
|
||||
JFileChooser minecraftDirPop = new JFileChooser();
|
||||
switch (Platform.get())
|
||||
switch (EPlatform.get())
|
||||
{
|
||||
case WINDOWS:
|
||||
minecraftDirPop.setCurrentDirectory(new File(System.getenv("APPDATA") + "/.minecraft/mods"));
|
||||
|
||||
@@ -143,15 +143,15 @@ public class JarUtils
|
||||
}
|
||||
|
||||
|
||||
/** Please use the Platform enum instead */
|
||||
/** Please use the EPlatform enum instead */
|
||||
@Deprecated
|
||||
public enum OperatingSystem
|
||||
{WINDOWS, MACOS, LINUX, NONE} // Easy to use enum for the 3 main os's
|
||||
/** Please use the Platform enum instead */
|
||||
/** Please use the EPlatform enum instead */
|
||||
@Deprecated
|
||||
public static OperatingSystem getOperatingSystem()
|
||||
{ // Get the os and turn it into that enum
|
||||
switch (Platform.get())
|
||||
switch (EPlatform.get())
|
||||
{
|
||||
case WINDOWS:
|
||||
return OperatingSystem.WINDOWS;
|
||||
|
||||
@@ -21,9 +21,9 @@ package com.seibel.distanthorizons.core.jar.updater;
|
||||
|
||||
import com.seibel.distanthorizons.core.config.Config;
|
||||
import com.seibel.distanthorizons.core.dependencyInjection.SingletonInjector;
|
||||
import com.seibel.distanthorizons.core.jar.EPlatform;
|
||||
import com.seibel.distanthorizons.core.jar.JarUtils;
|
||||
import com.seibel.distanthorizons.core.jar.ModGitInfo;
|
||||
import com.seibel.distanthorizons.core.jar.Platform;
|
||||
import com.seibel.distanthorizons.core.jar.installer.GitlabGetter;
|
||||
import com.seibel.distanthorizons.core.jar.installer.ModrinthGetter;
|
||||
import com.seibel.distanthorizons.core.jar.installer.WebDownloader;
|
||||
@@ -305,7 +305,7 @@ public class SelfUpdater
|
||||
}
|
||||
try
|
||||
{
|
||||
if (Platform.get() != Platform.WINDOWS)
|
||||
if (EPlatform.get() != EPlatform.WINDOWS)
|
||||
{
|
||||
Files.delete(JarUtils.jarFile.toPath());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user