Enum Class Platform

java.lang.Object
java.lang.Enum<Platform>
one.tranic.t.utils.Platform
All Implemented Interfaces:
Serializable, Comparable<Platform>, Constable

public enum Platform extends Enum<Platform>
Enum representing various Minecraft server platforms. Supported platforms include:
  • Enum Constant Details

    • Velocity

      public static final Platform Velocity
      Represents the Velocity platform. Velocity is a modern Minecraft proxy server designed for high performance and flexibility.
    • BungeeCord

      public static final Platform BungeeCord
      Represents the BungeeCord platform. BungeeCord is a classic Minecraft proxy server.
    • Spigot

      public static final Platform 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

      public static final Platform Paper
      Represents the Paper platform. Paper is a fork of Spigot that further optimizes server performance and adds additional features for plugins.
    • ShreddedPaper

      public static final Platform ShreddedPaper
      Represents the ShreddedPaper platform. ShreddedPaper is a highly specialized fork of Paper, designed for improved threading in Minecraft servers.
    • Folia

      public static final Platform 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

      public static Platform[] 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

      public static Platform valueOf(String name)
      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 name
      NullPointerException - if the argument is null
    • get

      @NotNull public static @NotNull Platform 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.

      Returns:
      the detected Platform, or Spigot as the default if no other platform is found.
    • of

      @NotNull public static @NotNull Platform of(@NotNull @NotNull String name)
      Returns the Platform corresponding 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 Platform enum 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 Spiot, Paper, Folia, or ShreddedPaper; false otherwise
    • isMultithreading

      public static boolean isMultithreading()
      Determines whether the current environment supports multithreading features.
      Returns:
      true if the environment supports multithreading, false otherwise.
    • toString

      @NotNull public @NotNull String toString()
      Returns the lowercase string representation of the platform.
      Overrides:
      toString in class Enum<Platform>
      Returns:
      the platform name in lowercase (e.g., "velocity", "spigot").
    • toRawString

      @NotNull public @NotNull String toRawString()
    • getClassPath

      public String 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.