Fixed duplication bug with autocrafting and External Storages. Fixes #2021
This commit is contained in:
		| @@ -10,6 +10,7 @@ | |||||||
| - Fixed oredict autocrafting sometimes reporting that a craftable item is missing (raoulvdberge) | - Fixed oredict autocrafting sometimes reporting that a craftable item is missing (raoulvdberge) | ||||||
| - Fixed fluid autocrafting without item inputs locking when there's not enough space for the fluids (raoulvdberge) | - Fixed fluid autocrafting without item inputs locking when there's not enough space for the fluids (raoulvdberge) | ||||||
| - Fixed Grid "last changed" date not changing when using clear button or JEI transfer (raoulvdberge) | - Fixed Grid "last changed" date not changing when using clear button or JEI transfer (raoulvdberge) | ||||||
|  | - Fixed duplication bug with autocrafting and External Storages (raoulvdberge) | ||||||
| - Removed handling of reusable items in autocrafting, to avoid problems (raoulvdberge) | - Removed handling of reusable items in autocrafting, to avoid problems (raoulvdberge) | ||||||
| - You can no longer start a crafting task if it has missing items or fluids (raoulvdberge) | - You can no longer start a crafting task if it has missing items or fluids (raoulvdberge) | ||||||
|  |  | ||||||
|   | |||||||
| @@ -70,31 +70,17 @@ public class StorageExternalItem implements IStorageExternal<ItemStack> { | |||||||
|             } else if (cached.isEmpty() && !actual.isEmpty()) { |             } else if (cached.isEmpty() && !actual.isEmpty()) { | ||||||
|                 // If the cached is empty and the actual isn't, we added this item |                 // If the cached is empty and the actual isn't, we added this item | ||||||
|                 network.getItemStorageCache().add(actual, actual.getCount(), false, true); |                 network.getItemStorageCache().add(actual, actual.getCount(), false, true); | ||||||
|  |  | ||||||
|                 // When we use an interface + crafting upgrade + external storage combo, we don't want the crafting task |  | ||||||
|                 // to think we inserted twice. |  | ||||||
|                 if (!isConnectedToInterface()) { |  | ||||||
|                     network.getCraftingManager().track(actual, actual.getCount()); |  | ||||||
|                 } |  | ||||||
|             } else if (cached.isEmpty() && actual.isEmpty()) { |             } else if (cached.isEmpty() && actual.isEmpty()) { | ||||||
|                 // If they're both empty, nothing happens |                 // If they're both empty, nothing happens | ||||||
|             } else if (!API.instance().getComparer().isEqualNoQuantity(cached, actual)) { |             } else if (!API.instance().getComparer().isEqualNoQuantity(cached, actual)) { | ||||||
|                 // If both items mismatch, remove the old and add the new |                 // If both items mismatch, remove the old and add the new | ||||||
|                 network.getItemStorageCache().remove(cached, cached.getCount(), true); |                 network.getItemStorageCache().remove(cached, cached.getCount(), true); | ||||||
|                 network.getItemStorageCache().add(actual, actual.getCount(), false, true); |                 network.getItemStorageCache().add(actual, actual.getCount(), false, true); | ||||||
|  |  | ||||||
|                 if (!isConnectedToInterface()) { |  | ||||||
|                     network.getCraftingManager().track(actual, actual.getCount()); |  | ||||||
|                 } |  | ||||||
|             } else if (cached.getCount() != actual.getCount()) { |             } else if (cached.getCount() != actual.getCount()) { | ||||||
|                 int delta = actual.getCount() - cached.getCount(); |                 int delta = actual.getCount() - cached.getCount(); | ||||||
|  |  | ||||||
|                 if (delta > 0) { |                 if (delta > 0) { | ||||||
|                     network.getItemStorageCache().add(actual, delta, false, true); |                     network.getItemStorageCache().add(actual, delta, false, true); | ||||||
|  |  | ||||||
|                     if (!isConnectedToInterface()) { |  | ||||||
|                         network.getCraftingManager().track(actual, delta); |  | ||||||
|                     } |  | ||||||
|                 } else { |                 } else { | ||||||
|                     network.getItemStorageCache().remove(actual, Math.abs(delta), true); |                     network.getItemStorageCache().remove(actual, Math.abs(delta), true); | ||||||
|                 } |                 } | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 raoulvdberge
					raoulvdberge