Skip to content

Commit

Permalink
minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
ghzdude committed Jul 20, 2024
1 parent 182963e commit c09fdca
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -361,9 +361,11 @@ public void detectAndSendChanges(boolean init) {
// check if substitute exists
if (!slot.hasIngredients) {
ItemStack substitute = findSubstitute(slot.getIndex(), slotStack);
count = requiredItems.getOrDefault(substitute, 0);
requiredItems.put(substitute.copy(), ++count);
slot.hasIngredients = !substitute.isEmpty() && simulateExtractItem(substitute, count);
if (!substitute.isEmpty()) {
count = requiredItems.getOrDefault(substitute, 0);
requiredItems.put(substitute.copy(), ++count);
slot.hasIngredients = simulateExtractItem(substitute, count);
}
}

if (old != slot.hasIngredients)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,11 @@ private MemorizedRecipe offsetRecipe(int startIndex) {
for (int i = startIndex + 1; i < memorizedRecipes.length; i++) {
MemorizedRecipe recipe = memorizedRecipes[i];
if (recipe != null && recipe.recipeLocked) continue;
memorizedRecipes[i] = previousRecipe.copy();
memorizedRecipes[i] = previousRecipe;
memorizedRecipes[i].index = i;
if (recipe == null) return null;
if (recipe == null)
return memorizedRecipes[startIndex] = null;

previousRecipe = recipe;
}
return previousRecipe;
Expand Down

0 comments on commit c09fdca

Please sign in to comment.