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
|
||||
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));
|
||||
|
||||
ListNBT list = tag.getList(FluidStorageDisk.NBT_FLUIDS, Constants.NBT.TAG_COMPOUND);
|
||||
@@ -37,10 +33,6 @@ public class FluidStorageDiskFactory implements IStorageDiskFactory<FluidStack>
|
||||
|
||||
@Override
|
||||
public IStorageDisk<FluidStack> create(ServerWorld world, int capacity) {
|
||||
if (world == null) {
|
||||
throw new IllegalArgumentException("World cannot be null");
|
||||
}
|
||||
|
||||
return new FluidStorageDisk(world, capacity);
|
||||
}
|
||||
}
|
||||
|
@@ -17,10 +17,6 @@ public class ItemStorageDiskFactory implements IStorageDiskFactory<ItemStack> {
|
||||
|
||||
@Override
|
||||
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));
|
||||
|
||||
ListNBT list = tag.getList(ItemStorageDisk.NBT_ITEMS, Constants.NBT.TAG_COMPOUND);
|
||||
@@ -38,10 +34,6 @@ public class ItemStorageDiskFactory implements IStorageDiskFactory<ItemStack> {
|
||||
|
||||
@Override
|
||||
public IStorageDisk<ItemStack> create(ServerWorld world, int capacity) {
|
||||
if (world == null) {
|
||||
throw new IllegalArgumentException("World cannot be null");
|
||||
}
|
||||
|
||||
return new ItemStorageDisk(world, capacity);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user