Enum Platform.Type

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<Platform.Type>
    Enclosing interface:
    Platform

    public static enum Platform.Type
    extends java.lang.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 Summary

      Enum Constants 
      Enum Constant Description
      CLIENT
      The platform of a Minecraft CLIENT is expected.
      SERVER
      The platform of a Minecraft SERVER is expected.
      UNKNOWN
      It is unknown what platform the game is running on.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean isClient()
      Checks for whether the platform is CLIENT.
      boolean isKnown()
      Checks for whether the platform is known.
      boolean isServer()
      Checks for whether the platform is SERVER.
      static Platform.Type valueOf​(java.lang.String name)
      Returns the enum constant of this type with the specified name.
      static Platform.Type[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      • Methods inherited from class java.lang.Enum

        clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • 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​(java.lang.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:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.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