Class MinecartComparatorLogicRegistry
java.lang.Object
net.fabricmc.fabric.api.object.builder.v1.entity.MinecartComparatorLogicRegistry
A registry for custom minecart compator logic.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic @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.static <T extends net.minecraft.entity.vehicle.AbstractMinecartEntity>
voidregister
(net.minecraft.entity.EntityType<T> type, MinecartComparatorLogic<? super T> logic) Registers a comparator logic for a minecart entity type.
-
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 typelogic
- the logic to register
-