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>>
  • 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)
      Specified by:
      setFromArgument in class net.minecraft.world.GameRules.Rule<EnumRule<E extends Enum<E>>>
    • deserialize

      protected void deserialize(String value)
      Specified by:
      deserialize in class net.minecraft.world.GameRules.Rule<EnumRule<E extends Enum<E>>>
    • serialize

      public String serialize()
      Specified by:
      serialize in class net.minecraft.world.GameRules.Rule<EnumRule<E extends Enum<E>>>
    • getCommandResult

      public int getCommandResult()
      Specified by:
      getCommandResult in class net.minecraft.world.GameRules.Rule<EnumRule<E extends Enum<E>>>
    • getThis

      protected EnumRule<E> getThis()
      Specified by:
      getThis in class net.minecraft.world.GameRules.Rule<EnumRule<E extends Enum<E>>>
    • getEnumClass

      public Class<E> getEnumClass()
    • toString

      public String toString()
      Overrides:
      toString in class net.minecraft.world.GameRules.Rule<EnumRule<E extends Enum<E>>>
    • copy

      protected EnumRule<E> copy()
      Specified by:
      copy in class net.minecraft.world.GameRules.Rule<EnumRule<E extends Enum<E>>>
    • setValue

      public void setValue(EnumRule<E> rule, net.minecraft.server.MinecraftServer minecraftServer)
      Specified by:
      setValue in class net.minecraft.world.GameRules.Rule<EnumRule<E extends Enum<E>>>
    • get

      public E get()
    • cycle

      public void cycle()
      Cycles the value of this enum rule to the next supported value.
    • supports

      public boolean supports(E value)
    • set

      public void set(E value, @Nullable @Nullable net.minecraft.server.MinecraftServer server) throws IllegalArgumentException
      Throws:
      IllegalArgumentException