Fix crash when deserializing crafting tasks due to null check
This commit is contained in:
@@ -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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user