Skip to content

Commit

Permalink
Unusual Crafting
Browse files Browse the repository at this point in the history
- Fixed crash with JEI when a modded crafting recipe has an inconsistent ingredient list #6368 #6494
  • Loading branch information
simibubi committed Jul 16, 2024
1 parent 127724b commit 00e919b
Showing 1 changed file with 15 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -99,16 +99,21 @@ public void draw(CraftingRecipe recipe, IRecipeSlotsView iRecipeSlotsView, PoseS
matrixStack.translate(getXPadding(recipe), getYPadding(recipe), 0);

for (int row = 0; row < getHeight(recipe); row++)
for (int col = 0; col < getWidth(recipe); col++)
if (!recipe.getIngredients()
.get(row * getWidth(recipe) + col)
.isEmpty()) {
matrixStack.pushPose();
matrixStack.translate(col * 19 * scale, row * 19 * scale, 0);
matrixStack.scale(scale, scale, scale);
AllGuiTextures.JEI_SLOT.render(matrixStack, 0, 0);
matrixStack.popPose();
}
for (int col = 0; col < getWidth(recipe); col++) {
int pIndex = row * getWidth(recipe) + col;
if (pIndex >= recipe.getIngredients()
.size())
break;
if (recipe.getIngredients()
.get(pIndex)
.isEmpty())
continue;
matrixStack.pushPose();
matrixStack.translate(col * 19 * scale, row * 19 * scale, 0);
matrixStack.scale(scale, scale, scale);
AllGuiTextures.JEI_SLOT.render(matrixStack, 0, 0);
matrixStack.popPose();
}

matrixStack.popPose();

Expand Down

0 comments on commit 00e919b

Please sign in to comment.