From a30f094efa98ca3f6f7c267e83a556ef8054c6ab Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Sat, 3 Dec 2016 23:43:42 +0100 Subject: [PATCH] Maybe fix a crash with the fermenting barrel? --- .../mod/blocks/base/BlockContainerBase.java | 4 +++- .../mod/tile/TileEntityFermentingBarrel.java | 5 ++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/base/BlockContainerBase.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/base/BlockContainerBase.java index 295be905f..da42cb995 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/base/BlockContainerBase.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/base/BlockContainerBase.java @@ -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); + } } } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityFermentingBarrel.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityFermentingBarrel.java index 023a6817a..9233e3ceb 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityFermentingBarrel.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityFermentingBarrel.java @@ -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); }