use of buildcraft.factory.tile.TileFloodGate in project BuildCraft by BuildCraft.
the class BlockFloodGate method onBlockActivated.
@Override
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, EnumFacing side, float hitX, float hitY, float hitZ) {
ItemStack heldItem = player.getHeldItem(hand);
if (heldItem.getItem() instanceof IToolWrench) {
if (!world.isRemote) {
if (side != EnumFacing.UP) {
TileEntity tile = world.getTileEntity(pos);
if (tile instanceof TileFloodGate) {
if (CONNECTED_MAP.containsKey(side)) {
TileFloodGate floodGate = (TileFloodGate) tile;
if (!floodGate.openSides.remove(side)) {
floodGate.openSides.add(side);
}
floodGate.queue.clear();
floodGate.sendNetworkUpdate(TileBC_Neptune.NET_RENDER_DATA);
return true;
}
}
}
}
return false;
}
return super.onBlockActivated(world, pos, state, player, hand, side, hitX, hitY, hitZ);
}
Aggregations