Interface FabricGameRuleVisitor

All Superinterfaces:
net.minecraft.world.GameRules.Visitor

public interface FabricGameRuleVisitor extends net.minecraft.world.GameRules.Visitor
An extended game rule visitor which supports Fabric's own rule types.

Game rule visitors are typically used iterating all game rules. In vanilla, the visitor is used to register game rule commands and populate the Edit Game Rules screen.

Rule types specified by this interface are not exhaustive. New entries may be added in the future.

  • Method Summary

    Modifier and Type
    Method
    Description
    default void
    visitDouble​(net.minecraft.world.GameRules.Key<DoubleRule> key, net.minecraft.world.GameRules.Type<DoubleRule> type)
    Visit a double rule.
    default <E extends Enum<E>>
    void
    visitEnum​(net.minecraft.world.GameRules.Key<EnumRule<E>> key, net.minecraft.world.GameRules.Type<EnumRule<E>> type)
    Visit an enum rule.

    Methods inherited from interface net.minecraft.world.GameRules.Visitor

    visit, visitBoolean, visitInt
  • Method Details

    • visitDouble

      default void visitDouble(net.minecraft.world.GameRules.Key<DoubleRule> key, net.minecraft.world.GameRules.Type<DoubleRule> type)
      Visit a double rule.

      Note GameRules.Visitor.visit(GameRules.Key, GameRules.Type) will be called before this method is visited.

      Parameters:
      key - the rule key
      type - the rule type
    • visitEnum

      default <E extends Enum<E>> void visitEnum(net.minecraft.world.GameRules.Key<EnumRule<E>> key, net.minecraft.world.GameRules.Type<EnumRule<E>> type)
      Visit an enum rule.

      Note GameRules.Visitor.visit(GameRules.Key, GameRules.Type) will be called before this method is visited.

      Parameters:
      key - the rule key
      type - the rule type