Maybe fixed a bug caused by desync that would cause blocks to have ridiculous amounts of energy/luqiuid

This commit is contained in:
Ellpeck 2016-01-09 17:30:24 +01:00
parent 61b921b2dd
commit 0d00143298

View file

@ -159,16 +159,19 @@ public abstract class BlockContainerBase extends BlockContainer{
if(tile instanceof IEnergySaver){
((IEnergySaver)tile).setEnergy(stack.getTagCompound().getInteger("Energy"));
stack.getTagCompound().removeTag("Energy");
}
if(tile instanceof IFluidSaver){
int amount = stack.getTagCompound().getInteger("FluidAmount");
stack.getTagCompound().removeTag("FluidAmount");
if(amount > 0){
FluidStack[] fluids = new FluidStack[amount];
for(int i = 0; i < amount; i++){
NBTTagCompound compound = stack.getTagCompound().getCompoundTag("Fluid"+i);
stack.getTagCompound().removeTag("Fluid"+i);
if(compound != null){
fluids[i] = FluidStack.loadFluidStackFromNBT(compound);
}