Class MinecartComparatorLogicRegistry

java.lang.Object
net.fabricmc.fabric.api.object.builder.v1.entity.MinecartComparatorLogicRegistry

public final class MinecartComparatorLogicRegistry extends Object
  • Constructor Details

    • MinecartComparatorLogicRegistry

      public MinecartComparatorLogicRegistry()
  • Method Details

    • getCustomComparatorLogic

      @Nullable public static @Nullable MinecartComparatorLogic<net.minecraft.entity.vehicle.AbstractMinecartEntity> getCustomComparatorLogic(net.minecraft.entity.EntityType<?> type)
      Gets the registered custom comparator logic for the specified minecart entity type.
      Parameters:
      type - the entity type
      Returns:
      the comparator logic, or null if not registered
    • register

      public static <T extends net.minecraft.entity.vehicle.AbstractMinecartEntity> void register(net.minecraft.entity.EntityType<T> type, MinecartComparatorLogic<? super T> logic)
      Registers a comparator logic for a minecart entity type.

      Registering a second value for an entity type will replace the old logic.

      Type Parameters:
      T - the handled minecart type
      Parameters:
      type - the minecart entity type
      logic - the logic to register