public class GameRules
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
(package private) static class |
GameRules.Value |
static class |
GameRules.ValueType |
Modifier and Type | Field and Description |
---|---|
private java.util.TreeMap<java.lang.String,GameRules.Value> |
rules |
Constructor and Description |
---|
GameRules() |
Modifier and Type | Method and Description |
---|---|
void |
addGameRule(java.lang.String key,
java.lang.String value,
GameRules.ValueType type) |
boolean |
areSameType(java.lang.String key,
GameRules.ValueType otherValue) |
boolean |
getBoolean(java.lang.String name) |
int |
getInt(java.lang.String name) |
java.lang.String[] |
getRules() |
java.lang.String |
getString(java.lang.String name) |
boolean |
hasRule(java.lang.String name) |
void |
readFromNBT(NBTTagCompound nbt) |
void |
setOrCreateGameRule(java.lang.String key,
java.lang.String ruleValue) |
NBTTagCompound |
writeToNBT() |
private final java.util.TreeMap<java.lang.String,GameRules.Value> rules
public void addGameRule(java.lang.String key, java.lang.String value, GameRules.ValueType type)
public void setOrCreateGameRule(java.lang.String key, java.lang.String ruleValue)
public java.lang.String getString(java.lang.String name)
public boolean getBoolean(java.lang.String name)
public int getInt(java.lang.String name)
public NBTTagCompound writeToNBT()
public void readFromNBT(NBTTagCompound nbt)
public java.lang.String[] getRules()
public boolean hasRule(java.lang.String name)
public boolean areSameType(java.lang.String key, GameRules.ValueType otherValue)