Class GameRule<T>

java.lang.Object
net.minecraft.world.level.gamerules.GameRule<T>
All Implemented Interfaces:
FeatureElement

public final class GameRule<T> extends Object implements FeatureElement
  • Field Details

    • category

      private final GameRuleCategory category
    • gameRuleType

      private final GameRuleType gameRuleType
    • argument

      private final com.mojang.brigadier.arguments.ArgumentType<T> argument
    • visitorCaller

      private final GameRules.VisitorCaller<T> visitorCaller
    • valueCodec

      private final com.mojang.serialization.Codec<T> valueCodec
    • commandResultFunction

      private final ToIntFunction<T> commandResultFunction
    • defaultValue

      private final T defaultValue
    • requiredFeatures

      private final FeatureFlagSet requiredFeatures
  • Constructor Details

  • Method Details

    • toString

      public String toString()
      Overrides:
      toString in class Object
    • id

      public String id()
    • getIdentifier

      public Identifier getIdentifier()
    • getDescriptionId

      public String getDescriptionId()
    • serialize

      public String serialize(T pValue)
    • deserialize

      public com.mojang.serialization.DataResult<T> deserialize(String pValue)
    • valueClass

      public Class<T> valueClass()
    • callVisitor

      public void callVisitor(GameRuleTypeVisitor pVisitor)
    • getCommandResult

      public int getCommandResult(T pValue)
    • category

      public GameRuleCategory category()
    • gameRuleType

      public GameRuleType gameRuleType()
    • argument

      public com.mojang.brigadier.arguments.ArgumentType<T> argument()
    • valueCodec

      public com.mojang.serialization.Codec<T> valueCodec()
    • defaultValue

      public T defaultValue()
    • requiredFeatures

      public FeatureFlagSet requiredFeatures()
      Specified by:
      requiredFeatures in interface FeatureElement