package net.qbar.common.block;

import net.minecraft.block.material.Material;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumHand;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import net.qbar.common.tile.TileTank;
import net.qbar.common.util.FluidUtils;

public class BlockTank extends BlockMachineBase
{
    public BlockTank()
    {
        super("tank", Material.IRON);
    }

    @Override
    public boolean onBlockActivated(final World w, final BlockPos pos, final IBlockState state,
            final EntityPlayer player, final EnumHand hand, final EnumFacing facing, final float hitX, final float hitY,
            final float hitZ)
    {
        if (player.isSneaking())
            return false;
        if (!w.isRemote)
        {
            final TileTank tank = (TileTank) w.getTileEntity(pos);

            if (tank != null)
            {
                if (FluidUtils.drainPlayerHand(tank.getTank(), player)
                        || FluidUtils.fillPlayerHand(tank.getTank(), player))
                    return true;
            }
        }
        return false;
    }

    @Override
    public TileEntity createNewTileEntity(final World worldIn, final int meta)
    {
        return new TileTank();
    }
}

@@ -892,47 +892,9 @@
 se;%0A
-        if (!w.isRemote)%0A        %7B%0A    
+%0A
     
@@ -957,28 +957,24 @@
 );%0A%0A        
-    
 if (tank != 
@@ -979,20 +979,16 @@
 = null)%0A
-    
         
@@ -997,28 +997,24 @@
             
-    
 if (FluidUti
@@ -1059,32 +1059,8 @@
 yer)
-%0A                       
  %7C%7C 
@@ -1122,28 +1122,24 @@
             
-    
 return true;
@@ -1143,22 +1143,8 @@
 ue;%0A
-            %7D%0A
     

Fix side check in tank filling