diff --git a/src/main/java/tinkersurvival/recipe/ShapedOreRecipeHelper.java b/src/main/java/tinkersurvival/recipe/ShapedOreRecipeHelper.java index a40e514..2927df5 100644 --- a/src/main/java/tinkersurvival/recipe/ShapedOreRecipeHelper.java +++ b/src/main/java/tinkersurvival/recipe/ShapedOreRecipeHelper.java @@ -1,5 +1,8 @@ package tinkersurvival.recipe; +import java.util.HashMap; +import java.util.Map; + import net.minecraft.init.Items; import net.minecraft.inventory.InventoryCrafting; import net.minecraft.item.ItemStack; @@ -24,6 +27,7 @@ public ShapedOreRecipeHelper(ResourceLocation group, ItemStack result, Object... @Override public NonNullList getRemainingItems(InventoryCrafting inv) { NonNullList remains = super.getRemainingItems(inv); + Map returnItems = new HashMap<>(); for (int i = 0; i < remains.size(); i++) { ItemStack slot = inv.getStackInSlot(i); @@ -46,15 +50,18 @@ public NonNullList getRemainingItems(InventoryCrafting inv) { && (tool.getItem() instanceof Saw || tool.getItem() instanceof Knife)) { ItemStack tool2 = tool.copy(); tool = ItemStack.EMPTY; - remains.set(i + 1, tool2); + returnItems.put(i + 1, tool2); } } else { tool = slot.copy(); } - remains.set(i, tool); + returnItems.put(i, tool); } } + for (Map.Entry entry : returnItems.entrySet()) { + remains.set(entry.getKey(), entry.getValue()); + } return remains; }