Fix crash when deserializing crafting tasks due to null check

This commit is contained in:
raoulvdberge
2019-10-29 00:23:55 +01:00
parent ac379e8e60
commit c9783296f6
2 changed files with 0 additions and 16 deletions

View File

@@ -16,10 +16,6 @@ public class FluidStorageDiskFactory implements IStorageDiskFactory<FluidStack>
@Override @Override
public IStorageDisk<FluidStack> createFromNbt(ServerWorld world, CompoundNBT tag) { public IStorageDisk<FluidStack> createFromNbt(ServerWorld world, CompoundNBT tag) {
if (world == null) {
throw new IllegalArgumentException("World cannot be null");
}
FluidStorageDisk disk = new FluidStorageDisk(world, tag.getInt(FluidStorageDisk.NBT_CAPACITY)); FluidStorageDisk disk = new FluidStorageDisk(world, tag.getInt(FluidStorageDisk.NBT_CAPACITY));
ListNBT list = tag.getList(FluidStorageDisk.NBT_FLUIDS, Constants.NBT.TAG_COMPOUND); ListNBT list = tag.getList(FluidStorageDisk.NBT_FLUIDS, Constants.NBT.TAG_COMPOUND);
@@ -37,10 +33,6 @@ public class FluidStorageDiskFactory implements IStorageDiskFactory<FluidStack>
@Override @Override
public IStorageDisk<FluidStack> create(ServerWorld world, int capacity) { public IStorageDisk<FluidStack> create(ServerWorld world, int capacity) {
if (world == null) {
throw new IllegalArgumentException("World cannot be null");
}
return new FluidStorageDisk(world, capacity); return new FluidStorageDisk(world, capacity);
} }
} }

View File

@@ -17,10 +17,6 @@ public class ItemStorageDiskFactory implements IStorageDiskFactory<ItemStack> {
@Override @Override
public IStorageDisk<ItemStack> createFromNbt(ServerWorld world, CompoundNBT tag) { public IStorageDisk<ItemStack> createFromNbt(ServerWorld world, CompoundNBT tag) {
if (world == null) {
throw new IllegalArgumentException("World cannot be null");
}
ItemStorageDisk disk = new ItemStorageDisk(world, tag.getInt(ItemStorageDisk.NBT_CAPACITY)); ItemStorageDisk disk = new ItemStorageDisk(world, tag.getInt(ItemStorageDisk.NBT_CAPACITY));
ListNBT list = tag.getList(ItemStorageDisk.NBT_ITEMS, Constants.NBT.TAG_COMPOUND); ListNBT list = tag.getList(ItemStorageDisk.NBT_ITEMS, Constants.NBT.TAG_COMPOUND);
@@ -38,10 +34,6 @@ public class ItemStorageDiskFactory implements IStorageDiskFactory<ItemStack> {
@Override @Override
public IStorageDisk<ItemStack> create(ServerWorld world, int capacity) { public IStorageDisk<ItemStack> create(ServerWorld world, int capacity) {
if (world == null) {
throw new IllegalArgumentException("World cannot be null");
}
return new ItemStorageDisk(world, capacity); return new ItemStorageDisk(world, capacity);
} }
} }