use of com.simibubi.create.content.logistics.block.belts.tunnel.BrassTunnelBlock in project Create by Creators-of-Create.
the class BeltTunnelInteractionHandler method stuckAtTunnel.
public static boolean stuckAtTunnel(BeltInventory beltInventory, int offset, ItemStack stack, Direction movementDirection) {
BeltTileEntity belt = beltInventory.belt;
BlockPos pos = BeltHelper.getPositionForOffset(belt, offset).above();
if (!(belt.getLevel().getBlockState(pos).getBlock() instanceof BrassTunnelBlock))
return false;
BlockEntity te = belt.getLevel().getBlockEntity(pos);
if (te == null || !(te instanceof BrassTunnelTileEntity))
return false;
BrassTunnelTileEntity tunnel = (BrassTunnelTileEntity) te;
return !tunnel.canInsert(movementDirection.getOpposite(), stack);
}
Aggregations