Interface WorldGameRules
- All Superinterfaces:
GameRules
The game rules as one world sees them: the overworld's base values, except for the rules this world overrides
- Since:
- 0.1.0
-
Method Summary
Modifier and TypeMethodDescriptionbooleanChecks whether this world holds the base values, that is whether it is the overworld.booleanisOverridden(TypedKey<GameRule> rule) Checks whether this world overrides a rule.Gets the rules this world overrides.booleanremoveOverride(TypedKey<GameRule> rule) Drops the override of a rule, so this world follows the base value again.world()Gets the world these rules apply to.Methods inherited from interface GameRules
definition, definition, definitions, getAsString, getBoolean, getInt, reset, set, setBoolean, setInt
-
Method Details
-
world
-
holdsBaseValues
-
isOverridden
Checks whether this world overrides a rule.- Parameters:
rule- any rule- Returns:
truewhen the value in effect here comes from this world, not from the base value- Throws:
IllegalArgumentException- if the rule is unknown- Since:
- 0.1.0
-
overrides
Gets the rules this world overrides.- Returns:
- the overridden rules, sorted by identifier; always empty for the overworld
- Since:
- 0.1.0
-
removeOverride
Drops the override of a rule, so this world follows the base value again.- Parameters:
rule- any rule- Returns:
truewhen an override was actually removed,falsewhen there was none or a listener cancelled the change- Throws:
IllegalArgumentException- if the rule is unknown- Since:
- 0.1.0
-