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>
-
Field Summary
Fields inherited from class net.minecraft.world.GameRules.Rule
type
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptioncopy()
void
cycle()
Cycles the value of this enum rule to the next supported value.protected void
deserialize(String value)
get()
int
getThis()
void
protected void
setFromArgument(com.mojang.brigadier.context.CommandContext<net.minecraft.server.command.ServerCommandSource> context, String name)
void
boolean
toString()
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
-