Package one.tranic.t.utils.minecraft
Enum Class Platform
- All Implemented Interfaces:
Serializable,Comparable<Platform>,Constable
Enum representing various Minecraft server platforms.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum Constants -
Method Summary
Modifier and TypeMethodDescriptionstatic @NotNull Platformget()Retrieves the currentPlatforminstance by detecting the underlying platform.String[]Retrieves the class path as a string.booleanis()Determines whether the specified class exists in the classpath.static booleanisBukkit()Determines whether the current platform is a Bukkit-based platform.static booleanChecks if the current server is Bukkit-based.static booleanDetermines whether the current server is a mixin of a mod loader and a Bukkit-based server.static booleanDetermines whether the current platform is a mod loader.static booleanChecks if any mod loader is present in the current environment.static booleanDetermines whether the current environment supports multithreading features.static booleanisProxy()Determines whether the current platform is a proxy-based platform.static @NotNull PlatformRetrieves thePlatforminstance corresponding to the provided platform name.@NotNull String@NotNull StringtoString()Returns the lowercase string representation of the platform.static PlatformReturns the enum constant of this class with the specified name.static Platform[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
Velocity
-
BungeeCord
-
Spigot
-
Paper
-
ShreddedPaper
-
Folia
-
Quilt
-
Fabric
-
NeoForge
-
Forge
-
Unknown
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
get
Retrieves the currentPlatforminstance by detecting the underlying platform.- Returns:
- the detected
Platforminstance, never null.
-
of
-
isBukkit
public static boolean isBukkit()Determines whether the current platform is a Bukkit-based platform.- Returns:
- true if the platform is one of Spiot, Paper, Folia, or ShreddedPaper; false otherwise
-
isModLoader
public static boolean isModLoader()Determines whether the current platform is a mod loader.- Returns:
- true if the current platform is a mod loader; false otherwise.
-
isProxy
public static boolean isProxy()Determines whether the current platform is a proxy-based platform.- Returns:
- true if the current platform is either Velocity or BungeeCord; false otherwise.
-
isMixinServer
public static boolean isMixinServer()Determines whether the current server is a mixin of a mod loader and a Bukkit-based server.- Returns:
- true if the server is both a mod loader (Forge, NeoForge, Quilt, or Fabric) and a Bukkit-based server (Spigot or Paper); false otherwise.
-
isModLoaderPresent
public static boolean isModLoaderPresent()Checks if any mod loader is present in the current environment.- Returns:
- true if Forge, NeoForge, Quilt, or Fabric is detected
-
isBukkitBasedServer
public static boolean isBukkitBasedServer()Checks if the current server is Bukkit-based.- Returns:
- true if Spigot or Paper is detected
-
isMultithreadedBukkit
public static boolean isMultithreadedBukkit()Determines whether the current environment supports multithreading features.- Returns:
- true if the environment supports multithreading, false otherwise.
-
toString
Returns the lowercase string representation of the platform. -
toRawString
-
getClassPath
Retrieves the class path as a string.- Returns:
- the class path of the current application.
-
is
public boolean is()Determines whether the specified class exists in the classpath.- Returns:
- true if the class exists in the classpath; false otherwise.
-