Hacky fix for disappearing items because of AutoCrafter

Should only be temporarily. Check if a slot is free or would be free after removing used ingredients and only then apply changes to the array
This commit is contained in:
Christian Koop 2020-04-17 15:19:16 +02:00 committed by Brianna
parent b6926b931f
commit 96076eb0e4

View File

@ -63,7 +63,12 @@ public class ModuleAutoCrafting extends Module {
}
synchronized (hopperCache) { //TODO: Check if this is required
ItemStack[] items = hopperCache.cachedInventory;
ItemStack[] items = new ItemStack[hopperCache.cachedInventory.length];
// TODO: Don't use that hacky workaround. Just don't modify it, if not meant to
for (int i = 0; i < hopperCache.cachedInventory.length; i++) {
items[i] = hopperCache.cachedInventory[i].clone();
}
for (SimpleRecipe recipe : getRecipes(toCraft).recipes) {
// key=indexForItemsArray, value=amountAfterCrafting