use of com.simibubi.create.content.contraptions.relays.advanced.GantryShaftBlock in project Create by Creators-of-Create.
the class GantryCarriageTileEntity method shouldAssemble.
private boolean shouldAssemble() {
BlockState blockState = getBlockState();
if (!(blockState.getBlock() instanceof GantryCarriageBlock))
return false;
Direction facing = blockState.getValue(GantryCarriageBlock.FACING).getOpposite();
BlockState shaftState = level.getBlockState(worldPosition.relative(facing));
if (!(shaftState.getBlock() instanceof GantryShaftBlock))
return false;
if (shaftState.getValue(GantryShaftBlock.POWERED))
return false;
BlockEntity te = level.getBlockEntity(worldPosition.relative(facing));
return te instanceof GantryShaftTileEntity && ((GantryShaftTileEntity) te).canAssembleOn();
}
Aggregations