Class CustomGameRuleCategory
java.lang.Object
net.fabricmc.fabric.api.gamerule.v1.CustomGameRuleCategory
Utility class for creating custom game rule categories outside of the categories
Minecraft provides
.-
Constructor Summary
ConstructorDescriptionCustomGameRuleCategory
(Identifier id, Text name) Creates a custom game rule category. -
Method Summary
Modifier and TypeMethodDescriptionboolean
static <T extends GameRules.Rule<T>>
Optional<CustomGameRuleCategory> getCategory
(GameRules.Key<T> key) Gets the custom category agame rule key
is registered to.getId()
getName()
int
hashCode()
-
Constructor Details
-
CustomGameRuleCategory
Creates a custom game rule category.- Parameters:
id
- the id of this categoryname
- the name of this category
-
-
Method Details
-
getId
-
getName
-
equals
-
hashCode
public int hashCode() -
getCategory
public static <T extends GameRules.Rule<T>> Optional<CustomGameRuleCategory> getCategory(GameRules.Key<T> key) Gets the custom category agame rule key
is registered to.- Type Parameters:
T
- the type of value the rule holds- Parameters:
key
- the rule key- Returns:
- the custom category this rule belongs to. Otherwise
empty
-