use of com.simibubi.create.content.contraptions.relays.belt.transport.ItemHandlerBeltSegment in project Create by Creators-of-Create.
the class BeltTileEntity method initializeItemHandler.
protected void initializeItemHandler() {
if (level.isClientSide || itemHandler.isPresent())
return;
if (!level.isLoaded(controller))
return;
BlockEntity te = level.getBlockEntity(controller);
if (te == null || !(te instanceof BeltTileEntity))
return;
BeltInventory inventory = ((BeltTileEntity) te).getInventory();
if (inventory == null)
return;
IItemHandler handler = new ItemHandlerBeltSegment(inventory, index);
itemHandler = LazyOptional.of(() -> handler);
}
Aggregations