Added VAT amount check

* Fixes #2061
* Also added missing sneaking check
This commit is contained in:
HenryLoenwind committed 2015-03-08 11:22:02 +01:00
1 parent 269523efe4
commit aae9a39c25
1 file changed
+9
@@ -113,6 +113,10 @@ public class BlockVat extends AbstractMachineBlock<TileVat> {
@Override
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer entityPlayer, int par6, float par7, float par8, float par9) {
if (entityPlayer.isSneaking()) {
return super.onBlockActivated(world, x, y, z, entityPlayer, par6, par7, par8, par9);
}
TileEntity te = world.getTileEntity(x, y, z);
if(!(te instanceof TileVat)) {
return super.onBlockActivated(world, x, y, z, entityPlayer, par6, par7, par8, par9);
@@ -155,6 +159,11 @@ public class BlockVat extends AbstractMachineBlock<TileVat> {
}
if(isValidFluid(filled)) {
if(filled.amount > available.amount) {
return super.onBlockActivated(world, x, y, z, entityPlayer, par6, par7, par8, par9);
}
vat.drain(ForgeDirection.DOWN, filled, true);
if(item.stackSize > 1) {
item.stackSize--;