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
ConstructorDescriptionDeprecated.You should not be calling this constructor!EnumRule
(GameRules.Type<EnumRule<E>> type, E value, Collection<E> supportedValues) Deprecated. -
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
set
(E value, @Nullable MinecraftServer server) protected void
setFromArgument
(com.mojang.brigadier.context.CommandContext<ServerCommandSource> context, String name) void
setValue
(EnumRule<E> rule, MinecraftServer minecraftServer) boolean
toString()
Methods inherited from class net.minecraft.world.GameRules.Rule
changed, set
-
Constructor Details
-
EnumRule
Deprecated.You should not be calling this constructor! -
EnumRule
@Deprecated public EnumRule(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<ServerCommandSource> context, String name) - Specified by:
setFromArgument
in classGameRules.Rule<EnumRule<E extends Enum<E>>>
-
deserialize
- Specified by:
deserialize
in classGameRules.Rule<EnumRule<E extends Enum<E>>>
-
serialize
-
getCommandResult
public int getCommandResult()- Specified by:
getCommandResult
in classGameRules.Rule<EnumRule<E extends Enum<E>>>
-
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 MinecraftServer server) throws IllegalArgumentException - Throws:
IllegalArgumentException
-