Package net.minecraft.world
Enum GameType
- java.lang.Object
-
- java.lang.Enum<GameType>
-
- net.minecraft.world.GameType
-
-
Constructor Summary
Constructors Modifier Constructor Description private
GameType(int p_i48711_3_, java.lang.String p_i48711_4_)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static GameType
byId(int p_77146_0_)
static GameType
byId(int p_185329_0_, GameType p_185329_1_)
static GameType
byName(java.lang.String p_77142_0_)
static GameType
byName(java.lang.String p_185328_0_, GameType p_185328_1_)
ITextComponent
getDisplayName()
int
getId()
java.lang.String
getName()
boolean
isBlockPlacingRestricted()
boolean
isCreative()
boolean
isSurvival()
void
updatePlayerAbilities(PlayerAbilities p_77147_1_)
static GameType
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.static GameType[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Method Detail
-
values
public static GameType[] 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 (GameType c : GameType.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static GameType valueOf(java.lang.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:
java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is null
-
getId
public int getId()
-
getName
public java.lang.String getName()
-
getDisplayName
public ITextComponent getDisplayName()
-
updatePlayerAbilities
public void updatePlayerAbilities(PlayerAbilities p_77147_1_)
-
isBlockPlacingRestricted
public boolean isBlockPlacingRestricted()
-
isCreative
public boolean isCreative()
-
isSurvival
public boolean isSurvival()
-
byId
public static GameType byId(int p_77146_0_)
-
byName
public static GameType byName(java.lang.String p_77142_0_)
-
-