Package one.tranic.t.util
Enum Class Platform
- All Implemented Interfaces:
Serializable,Comparable<Platform>,Constable
Enum representing various Minecraft server platforms.
Supported platforms include:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionRepresents the BungeeCord platform.Represents the Folia platform.Represents the Paper platform.Represents the ShreddedPaper platform.Represents the Spigot platform.Represents the Velocity platform. -
Method Summary
Modifier and TypeMethodDescriptionstatic @NotNull Platformget()Detects and returns the current platform.static booleanisBukkit()Determines whether the current platform is a Bukkit-based platform.static @NotNull PlatformReturns thePlatformcorresponding 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
Represents the Velocity platform. Velocity is a modern Minecraft proxy server designed for high performance and flexibility. -
BungeeCord
Represents the BungeeCord platform. BungeeCord is a classic Minecraft proxy server. -
Spigot
Represents the Spigot platform. Spigot is a highly optimized Minecraft server software, built from the vanilla Minecraft server, and is widely used for plugin support and performance improvements. -
Paper
Represents the Paper platform. Paper is a fork of Spigot that further optimizes server performance and adds additional features for plugins. -
ShreddedPaper
Represents the ShreddedPaper platform. ShreddedPaper is a highly specialized fork of Paper, designed for improved threading in Minecraft servers. -
Folia
Represents the Folia platform. Folia is a specialized fork of Paper with region-based multi-threading support for high-concurrency environments.
-
-
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
Detects and returns the current platform.This method uses reflection to check for specific platform classes and methods in the runtime environment, caching the result after the first check to avoid unnecessary overhead in future calls.
-
of
Returns thePlatformcorresponding to the provided platform name.This method compares the provided platform name (case-insensitive) to known platforms and returns the appropriate enum constant.
- Parameters:
name- the name of the platform (e.g., "velocity", "spigot")- Returns:
- the corresponding
Platformenum constant - Throws:
IllegalArgumentException- if the platform name is unknown
-
isBukkit
public static boolean isBukkit()Determines whether the current platform is a Bukkit-based platform.- Returns:
- true if the platform is one of Paper, Folia, or ShreddedPaper; false otherwise
-
toString
Returns the lowercase string representation of the platform. -
toRawString
-