Enum Platform.Type

  • All Implemented Interfaces:
    Serializable, Comparable<Platform.Type>
    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 Detail

      • 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 Detail

      • values

        public static Platform.Type[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (Platform.Type c : Platform.Type.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static Platform.Type valueOf​(String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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 type 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