Class MinecartComparatorLogicRegistry
java.lang.Object
net.fabricmc.fabric.api.object.builder.v1.entity.MinecartComparatorLogicRegistry
A registry for custom minecart comparator logic.
-
Method Summary
Modifier and TypeMethodDescriptionstatic @Nullable MinecartComparatorLogic<net.minecraft.world.entity.vehicle.minecart.AbstractMinecart> getCustomComparatorLogic(net.minecraft.world.entity.EntityType<?> type) Gets the registered custom comparator logic for the specified minecart entity type.static <T extends net.minecraft.world.entity.vehicle.minecart.AbstractMinecart>
voidregister(net.minecraft.world.entity.EntityType<T> type, MinecartComparatorLogic<? super T> logic) Registers a comparator logic for a minecart entity type.
-
Method Details
-
getCustomComparatorLogic
public static @Nullable MinecartComparatorLogic<net.minecraft.world.entity.vehicle.minecart.AbstractMinecart> getCustomComparatorLogic(net.minecraft.world.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
nullif not registered
-
register
public static <T extends net.minecraft.world.entity.vehicle.minecart.AbstractMinecart> void register(net.minecraft.world.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 typelogic- the logic to register
-