Enum Class Platform.Type

java.lang.Object
java.lang.Enum<Platform.Type>
org.spongepowered.api.Platform.Type
All Implemented Interfaces:
Serializable, Comparable<Platform.Type>, Constable
Enclosing interface:
Platform

public static enum Platform.Type extends Enum<Platform.Type>
The type of the platform, or where the game is currently running.

A side is what part of Minecraft this is being run on. The client, or the server. The internal server is also treated like a dedicated server.

  • Enum Constant Details

    • CLIENT

      public static final Platform.Type CLIENT
      The platform of a Minecraft CLIENT is expected.
    • SERVER

      public static final Platform.Type SERVER
      The platform of a Minecraft SERVER is expected.
    • UNKNOWN

      public static final Platform.Type UNKNOWN
      It is unknown what platform the game is running on.
  • Method Details

    • values

      public static Platform.Type[] 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.Type 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
    • isServer

      public boolean isServer()
      Checks for whether the platform is SERVER.
      Returns:
      True if the platform is SERVER, false otherwise
    • isClient

      public boolean isClient()
      Checks for whether the platform is CLIENT.
      Returns:
      True if the platform is CLIENT, false otherwise
    • isKnown

      public boolean isKnown()
      Checks for whether the platform is known.
      Returns:
      False if the platform is UNKNOWN, true otherwise