Class EnumRule<E extends Enum<E>>
java.lang.Object
net.minecraft.world.GameRules.Rule<EnumRule<E>>
net.fabricmc.fabric.api.gamerule.v1.rule.EnumRule<E>
public final class EnumRule<E extends Enum<E>> extends net.minecraft.world.GameRules.Rule<EnumRule<E>>
-
Field Summary
Fields inherited from class net.minecraft.world.GameRules.Rule
type -
Constructor Summary
Constructors Constructor Description EnumRule(net.minecraft.world.GameRules.Type<EnumRule<E>> type, E value, E[] supportedValues)Deprecated.You should not be calling this constructor!EnumRule(net.minecraft.world.GameRules.Type<EnumRule<E>> type, E value, Collection<E> supportedValues)Deprecated. -
Method Summary
Modifier and Type Method Description protected EnumRule<E>copy()voidcycle()Cycles the value of this enum rule to the next supported value.protected voiddeserialize(String value)Eget()intgetCommandResult()Class<E>getEnumClass()protected EnumRule<E>getThis()Stringserialize()voidset(E value, @Nullable net.minecraft.server.MinecraftServer server)protected voidsetFromArgument(com.mojang.brigadier.context.CommandContext<net.minecraft.server.command.ServerCommandSource> context, String name)voidsetValue(EnumRule<E> rule, net.minecraft.server.MinecraftServer minecraftServer)booleansupports(E value)StringtoString()Methods inherited from class net.minecraft.world.GameRules.Rule
changed, set
-
Constructor Details
-
EnumRule
@Deprecated public EnumRule(net.minecraft.world.GameRules.Type<EnumRule<E>> type, E value, E[] supportedValues)Deprecated.You should not be calling this constructor! -
EnumRule
@Deprecated public EnumRule(net.minecraft.world.GameRules.Type<EnumRule<E>> type, E value, Collection<E> supportedValues)Deprecated.You should not be calling this constructor!
-
-
Method Details
-
setFromArgument
protected void setFromArgument(com.mojang.brigadier.context.CommandContext<net.minecraft.server.command.ServerCommandSource> context, String name) -
deserialize
-
serialize
-
getCommandResult
public int getCommandResult() -
getThis
-
getEnumClass
-
toString
-
copy
-
setValue
-
get
-
cycle
public void cycle()Cycles the value of this enum rule to the next supported value. -
supports
-
set
public void set(E value, @Nullable @Nullable net.minecraft.server.MinecraftServer server) throws IllegalArgumentException- Throws:
IllegalArgumentException
-