Fix problems with fluid external storage

This commit is contained in:
raoulvdberge
2019-11-01 11:05:14 +01:00
parent 80a5f5fe60
commit 5a51767696
2 changed files with 4 additions and 2 deletions

View File

@@ -50,7 +50,9 @@ public class FluidStorageCache implements IStorageCache<FluidStack> {
} }
for (FluidStack stack : storage.getStacks()) { for (FluidStack stack : storage.getStacks()) {
add(stack, stack.getAmount(), true, false); if (!stack.isEmpty()) {
add(stack, stack.getAmount(), true, false);
}
} }
} }

View File

@@ -50,7 +50,7 @@ public class FluidExternalStorageCache {
if (actual.isEmpty() && !cached.isEmpty()) { // REMOVED if (actual.isEmpty() && !cached.isEmpty()) { // REMOVED
network.getFluidStorageCache().remove(cached, cached.getAmount(), true); network.getFluidStorageCache().remove(cached, cached.getAmount(), true);
cache.set(i, null); cache.set(i, FluidStack.EMPTY);
} else if (!actual.isEmpty() && cached.isEmpty()) { // ADDED } else if (!actual.isEmpty() && cached.isEmpty()) { // ADDED
network.getFluidStorageCache().add(actual, actual.getAmount(), false, true); network.getFluidStorageCache().add(actual, actual.getAmount(), false, true);