Package com.comphenix.protocol.wrappers
Enum Class EnumWrappers.NativeGameMode
java.lang.Object
java.lang.Enum<EnumWrappers.NativeGameMode>
com.comphenix.protocol.wrappers.EnumWrappers.NativeGameMode
- All Implemented Interfaces:
Serializable,Comparable<EnumWrappers.NativeGameMode>,Constable
- Enclosing class:
EnumWrappers
Represents a native game mode in Minecraft.
Not to be confused with GameMode in Bukkit.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum Constants -
Method Summary
Modifier and TypeMethodDescriptionstatic EnumWrappers.NativeGameModefromBukkit(org.bukkit.GameMode mode) Obtains the given GameMode's NativeGameMode equivalent.org.bukkit.GameModetoBukkit()Gets this NativeGameMode's Bukkit equivalent.static EnumWrappers.NativeGameModeReturns the enum constant of this class with the specified name.static EnumWrappers.NativeGameMode[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
NOT_SET
-
SURVIVAL
-
CREATIVE
-
ADVENTURE
-
SPECTATOR
-
NONE
Deprecated.Replaced by NOT_SET
-
-
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
-
toBukkit
public org.bukkit.GameMode toBukkit()Gets this NativeGameMode's Bukkit equivalent.Note: There is not a Bukkit equivalent for NOT_SET or NONE
- Returns:
- The Bukkit equivalent, or null if one does not exist.
-
fromBukkit
Obtains the given GameMode's NativeGameMode equivalent.- Parameters:
mode- Bukkit GameMode- Returns:
- The NativeGameMode equivalent, or null if one does not exist.
-