mirror of
https://github.com/Ellpeck/ActuallyAdditions.git
synced 2024-12-26 04:59:23 +01:00
Maybe fixed a bug caused by desync that would cause blocks to have ridiculous amounts of energy/luqiuid
This commit is contained in:
parent
61b921b2dd
commit
0d00143298
1 changed files with 3 additions and 0 deletions
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue