Enum Class Platform

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

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

    • Velocity

      public static final Platform Velocity
    • BungeeCord

      public static final Platform BungeeCord
    • Spigot

      public static final Platform Spigot
    • Paper

      public static final Platform Paper
    • ShreddedPaper

      public static final Platform ShreddedPaper
    • Folia

      public static final Platform Folia
    • Quilt

      public static final Platform Quilt
    • Fabric

      public static final Platform Fabric
    • NeoForge

      public static final Platform NeoForge
    • Forge

      public static final Platform Forge
    • Unknown

      public static final Platform Unknown
  • 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()
      Retrieves the current Platform instance by detecting the underlying platform.
      Returns:
      the detected Platform instance, never null.
    • of

      @NotNull public static @NotNull Platform of(@NotNull @NotNull String name)
      Retrieves the Platform instance corresponding to the provided platform name. If the name does not match any known platform, the Unknown instance will be returned.
      Parameters:
      name - the name of the platform. Must not be null.
      Returns:
      the matching Platform instance, or Unknown if no match is found.
    • 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

      @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.