public final class GameRuleRegistry extends Object
hasRegistration(String).
Creation of rule types is done using GameRuleFactory.
GameRuleFactory| Modifier and Type | Method and Description |
|---|---|
static boolean |
hasRegistration(String ruleName)
Checks if a name for a game rule is already registered.
|
static <T extends net.minecraft.world.GameRules.Rule<T>> |
register(String name,
CustomGameRuleCategory category,
net.minecraft.world.GameRules.Type<T> type)
Registers a
GameRules.Rule with a custom category. |
static <T extends net.minecraft.world.GameRules.Rule<T>> |
register(String name,
net.minecraft.world.GameRules.Category category,
net.minecraft.world.GameRules.Type<T> type)
Registers a
GameRules.Rule. |
public static <T extends net.minecraft.world.GameRules.Rule<T>> net.minecraft.world.GameRules.Key<T> register(String name, net.minecraft.world.GameRules.Category category, net.minecraft.world.GameRules.Type<T> type)
GameRules.Rule.T - the type of rulename - the name of the rulecategory - the category of this ruletype - the rule typeIllegalStateException - if a rule of the same name already existspublic static <T extends net.minecraft.world.GameRules.Rule<T>> net.minecraft.world.GameRules.Key<T> register(String name, CustomGameRuleCategory category, net.minecraft.world.GameRules.Type<T> type)
GameRules.Rule with a custom category.T - the type of rulename - the name of the rulecategory - the category of this ruletype - the rule typeIllegalStateException - if a rule of the same name already existspublic static boolean hasRegistration(String ruleName)
ruleName - the rule name to test