Fixed tank bug, thanks @Not_steve! Closes #553.

This commit is contained in:
Aidan Brady 2013-11-30 12:34:18 -05:00
parent a4ab6db57b
commit 0715a890bd

View file

@ -405,14 +405,19 @@ public class TankUpdateProtocol
structureFound.fluidStored = cache.fluid; structureFound.fluidStored = cache.fluid;
structureFound.inventory = cache.inventory; structureFound.inventory = cache.inventory;
if(structureFound.fluidStored != null)
{
structureFound.fluidStored.amount = Math.min(structureFound.fluidStored.amount, structureFound.volume*FLUID_PER_TANK);
}
for(Object3D obj : structureFound.locations) for(Object3D obj : structureFound.locations)
{ {
TileEntityDynamicTank tileEntity = (TileEntityDynamicTank)obj.getTileEntity(pointer.worldObj); TileEntityDynamicTank tileEntity = (TileEntityDynamicTank)obj.getTileEntity(pointer.worldObj);
tileEntity.inventoryID = idFound; tileEntity.inventoryID = idFound;
tileEntity.structure = structureFound; tileEntity.structure = structureFound;
tileEntity.cachedFluid = cache.fluid; tileEntity.cachedFluid = structureFound.fluidStored;
tileEntity.inventory = cache.inventory; tileEntity.inventory = structureFound.inventory;
} }
} }
else { else {