Enum Class GameMode
- All Implemented Interfaces:
Serializable, Comparable<GameMode>, Constable
-
Nested Class Summary
Nested classes/interfaces inherited from class Enum
Enum.EnumDesc<E> -
Enum Constant Summary
Enum Constants -
Method Summary
Modifier and TypeMethodDescriptionstatic GameModefromId(int id) Gets a GameMode by its numeric ID.static GameModefromNative(com.hypixel.hytale.protocol.GameMode nativeGameMode) Converts a native Hytale GameMode to a HytaleLoader GameMode.intgetId()Gets the numeric ID of this game mode.com.hypixel.hytale.protocol.GameModetoNative()Converts this HytaleLoader GameMode to the native Hytale GameMode.static GameModeReturns 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
-
CREATIVE
Creative mode - players have unlimited resources and cannot take damage. -
ADVENTURE
Adventure mode - default mode for players, similar to survival from Minecraft
-
-
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
public int getId()Gets the numeric ID of this game mode.- Returns:
- the game mode ID
-
toNative
public com.hypixel.hytale.protocol.GameMode toNative()Converts this HytaleLoader GameMode to the native Hytale GameMode.- Returns:
- the native Hytale GameMode instance
-
fromNative
Converts a native Hytale GameMode to a HytaleLoader GameMode.- Parameters:
nativeGameMode- the native Hytale game mode- Returns:
- the HytaleLoader GameMode, or SURVIVAL if null or unknown
-
fromId
Gets a GameMode by its numeric ID.- Parameters:
id- the game mode ID- Returns:
- the GameMode, or SURVIVAL if the ID is invalid
-