Search in sources :

Example 1 with BrassTunnelBlock

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);
}
Also used : BrassTunnelTileEntity(com.simibubi.create.content.logistics.block.belts.tunnel.BrassTunnelTileEntity) BeltTileEntity(com.simibubi.create.content.contraptions.relays.belt.BeltTileEntity) BrassTunnelBlock(com.simibubi.create.content.logistics.block.belts.tunnel.BrassTunnelBlock) BlockPos(net.minecraft.core.BlockPos) BlockEntity(net.minecraft.world.level.block.entity.BlockEntity)

Aggregations

BeltTileEntity (com.simibubi.create.content.contraptions.relays.belt.BeltTileEntity)1 BrassTunnelBlock (com.simibubi.create.content.logistics.block.belts.tunnel.BrassTunnelBlock)1 BrassTunnelTileEntity (com.simibubi.create.content.logistics.block.belts.tunnel.BrassTunnelTileEntity)1 BlockPos (net.minecraft.core.BlockPos)1 BlockEntity (net.minecraft.world.level.block.entity.BlockEntity)1