Maybe fix a crash with the fermenting barrel?

This commit is contained in:
Ellpeck 2016-12-03 23:43:42 +01:00
parent 52e87f8509
commit a30f094efa
2 changed files with 7 additions and 2 deletions

View file

@ -216,7 +216,9 @@ public abstract class BlockContainerBase extends BlockContainer implements ItemB
if(tile instanceof TileEntityBase){
TileEntityBase base = (TileEntityBase)tile;
NBTTagCompound compound = stack.getTagCompound().getCompoundTag("Data");
base.readSyncableNBT(compound, TileEntityBase.NBTType.SAVE_BLOCK);
if(compound != null){
base.readSyncableNBT(compound, TileEntityBase.NBTType.SAVE_BLOCK);
}
}
}
}

View file

@ -64,7 +64,10 @@ public class TileEntityFermentingBarrel extends TileEntityBase implements IShari
public void readSyncableNBT(NBTTagCompound compound, NBTType type){
this.currentProcessTime = compound.getInteger("ProcessTime");
this.canolaTank.readFromNBT(compound);
this.oilTank.readFromNBT((NBTTagCompound)compound.getTag("OilTank"));
NBTTagCompound tag = compound.getCompoundTag("OilTank");
if(tag != null){
this.oilTank.readFromNBT(tag);
}
super.readSyncableNBT(compound, type);
}