Package wtf.choco.veinminer.platform
Enum Class GameMode
- All Implemented Interfaces:
Serializable
,Comparable<GameMode>
,Constable
Represents a player's game mode.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic @Nullable GameMode
Get aGameMode
by its (case-insensitive) string id.static @NotNull GameMode
getByIdOrThrow
(@NotNull String id) Get aGameMode
by its (case-insensitive) string id.@NotNull String
getId()
Get the id of this game mode.static GameMode
Returns the enum constant of this class with the specified name.static GameMode[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
SURVIVAL
Survival mode. -
CREATIVE
Creative mode. -
ADVENTURE
Adventure mode. -
SPECTATOR
Spectator mode.
-
-
Method Details
-
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
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 nameNullPointerException
- if the argument is null
-
getId
Get the id of this game mode.- Returns:
- the id
-
getById
Get aGameMode
by its (case-insensitive) string id.- Parameters:
id
- the id of the game mode- Returns:
- the game mode
-
getByIdOrThrow
Get aGameMode
by its (case-insensitive) string id. If aGameMode
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
-