Fixes #883
This commit is contained in:
@@ -48,17 +48,23 @@ public abstract class StorageItemExternal implements IStorage<ItemStack> {
|
||||
} else if (cached.isEmpty() && !actual.isEmpty()) {
|
||||
// If the cached is empty and the actual isn't, we added this item
|
||||
network.getItemStorageCache().add(actual, actual.getCount(), false);
|
||||
|
||||
network.getCraftingManager().track(actual, actual.getCount());
|
||||
} else if (cached.isEmpty() && actual.isEmpty()) {
|
||||
// If they're both empty, nothing happens
|
||||
} else if (!API.instance().getComparer().isEqualNoQuantity(cached, actual)) {
|
||||
// If both items mismatch, remove the old and add the new
|
||||
network.getItemStorageCache().remove(cached, cached.getCount());
|
||||
network.getItemStorageCache().add(actual, actual.getCount(), false);
|
||||
|
||||
network.getCraftingManager().track(actual, actual.getCount());
|
||||
} else if (cached.getCount() != actual.getCount()) {
|
||||
int delta = actual.getCount() - cached.getCount();
|
||||
|
||||
if (delta > 0) {
|
||||
network.getItemStorageCache().add(actual, delta, false);
|
||||
|
||||
network.getCraftingManager().track(actual, delta);
|
||||
} else {
|
||||
network.getItemStorageCache().remove(actual, Math.abs(delta));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user