Enum Class GameMode

java.lang.Object
java.lang.Enum<GameMode>
wtf.choco.veinminer.platform.GameMode
All Implemented Interfaces:
Serializable, Comparable<GameMode>, Constable

public enum GameMode extends Enum<GameMode>
Represents a player's game mode.
  • Enum Constant Details

    • SURVIVAL

      public static final GameMode SURVIVAL
      Survival mode.
    • CREATIVE

      public static final GameMode CREATIVE
      Creative mode.
    • ADVENTURE

      public static final GameMode ADVENTURE
      Adventure mode.
    • SPECTATOR

      public static final GameMode SPECTATOR
      Spectator mode.
  • Method Details

    • values

      public static GameMode[] 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 GameMode 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
    • getId

      @NotNull public @NotNull String getId()
      Get the id of this game mode.
      Returns:
      the id
    • getById

      @Nullable public static @Nullable GameMode getById(@NotNull @NotNull String id)
      Get a GameMode by its (case-insensitive) string id.
      Parameters:
      id - the id of the game mode
      Returns:
      the game mode
    • getByIdOrThrow

      @NotNull public static @NotNull GameMode getByIdOrThrow(@NotNull @NotNull String id)
      Get a GameMode by its (case-insensitive) string id. If a GameMode with the given id does not exist, an exception will be thrown.
      Parameters:
      id - the id of the game mode
      Returns:
      the game mode
      Throws:
      IllegalArgumentException - if the game mode does not exist