Module gomint.api

Enum Difficulty

    • Method Detail

      • values

        public static Difficulty[] 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 (Difficulty c : Difficulty.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static Difficulty 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
      • valueOf

        public static Difficulty valueOf​(int degree)
        Gets a difficulty given its degree. Returns the difficulty matching the degree or null if no difficulty is assigned to the degree specified.
        Parameters:
        degree - The degree to get the difficulty of
        Returns:
        The game difficulty or null if not found
      • getDifficultyDegree

        public int getDifficultyDegree()
        Gets the degree of difficulty used inside binary formats such as the NBT inside any level.dat file to represent the game difficulty as an integer.
        Returns:
        The difficulty's degree