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 TypeMethodDescriptiongetCustomComparatorLogic
(EntityType<?> type) Gets the registered custom comparator logic for the specified minecart entity type.static <T extends AbstractMinecartEntity>
voidregister
(EntityType<T> type, MinecartComparatorLogic<? super T> logic) Registers a comparator logic for a minecart entity type.
-
Method Details
-
getCustomComparatorLogic
@Nullable public static @Nullable MinecartComparatorLogic<AbstractMinecartEntity> getCustomComparatorLogic(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 AbstractMinecartEntity> void register(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
-