diff --git a/CHANGELOG.md b/CHANGELOG.md index 11fd7f380..2a5055d81 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ - Updated Storage Drawers API (raoulvdberge) - Fixed bug where disks have to be re-inserted in the Disk Drive in order to work again after rejoining a chunk (raoulvdberge) - Fixed bug where items inserted in Storage Drawers through External Storage with a Drawer Controller wouldn't respect drawer priority rules (raoulvdberge) +- Fixed crash on server when getting an advancement (raoulvdberge) - Autocrafting can now fill water bottles with water from the fluid storage - regular bottles or pattern for regular bottles are required (raoulvdberge) ### 1.5.7 diff --git a/src/main/java/com/raoulvdberge/refinedstorage/apiimpl/storage/StorageDiskFluid.java b/src/main/java/com/raoulvdberge/refinedstorage/apiimpl/storage/StorageDiskFluid.java index b85e92d1d..0213e8030 100644 --- a/src/main/java/com/raoulvdberge/refinedstorage/apiimpl/storage/StorageDiskFluid.java +++ b/src/main/java/com/raoulvdberge/refinedstorage/apiimpl/storage/StorageDiskFluid.java @@ -227,7 +227,7 @@ public class StorageDiskFluid implements IStorageDisk { this.accessType = accessType; } - public static NBTTagCompound getShareTag(NBTTagCompound tag) { + public static NBTTagCompound getShareTag(@Nullable NBTTagCompound tag) { NBTTagCompound otherTag = new NBTTagCompound(); otherTag.setInteger(NBT_STORED, getStored(tag)); @@ -237,8 +237,8 @@ public class StorageDiskFluid implements IStorageDisk { return otherTag; } - public static int getStored(NBTTagCompound tag) { - return tag.getInteger(NBT_STORED); + public static int getStored(@Nullable NBTTagCompound tag) { + return tag == null ? 0 : tag.getInteger(NBT_STORED); } public static NBTTagCompound getTag() { diff --git a/src/main/java/com/raoulvdberge/refinedstorage/apiimpl/storage/StorageDiskItem.java b/src/main/java/com/raoulvdberge/refinedstorage/apiimpl/storage/StorageDiskItem.java index 01fb588a0..a6c845f4e 100644 --- a/src/main/java/com/raoulvdberge/refinedstorage/apiimpl/storage/StorageDiskItem.java +++ b/src/main/java/com/raoulvdberge/refinedstorage/apiimpl/storage/StorageDiskItem.java @@ -281,7 +281,7 @@ public class StorageDiskItem implements IStorageDisk { return inserted; } - public static NBTTagCompound getShareTag(NBTTagCompound tag) { + public static NBTTagCompound getShareTag(@Nullable NBTTagCompound tag) { NBTTagCompound otherTag = new NBTTagCompound(); otherTag.setInteger(NBT_STORED, getStored(tag)); @@ -291,8 +291,8 @@ public class StorageDiskItem implements IStorageDisk { return otherTag; } - public static int getStored(NBTTagCompound tag) { - return tag.getInteger(NBT_STORED); + public static int getStored(@Nullable NBTTagCompound tag) { + return tag == null ? 0 : tag.getInteger(NBT_STORED); } public static NBTTagCompound getTag() {