Skip to content

Commit

Permalink
Fix molding recipe focus showing some weird recipes
Browse files Browse the repository at this point in the history
  • Loading branch information
KnightMiner committed May 12, 2022
1 parent 1db05ba commit 9277da8
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import lombok.Getter;
import mezz.jei.api.constants.VanillaTypes;
import mezz.jei.api.gui.builder.IRecipeLayoutBuilder;
import mezz.jei.api.gui.builder.IRecipeSlotBuilder;
import mezz.jei.api.gui.drawable.IDrawable;
import mezz.jei.api.gui.ingredient.IRecipeSlotsView;
import mezz.jei.api.helpers.IGuiHelper;
Expand Down Expand Up @@ -99,9 +100,10 @@ public void setRecipe(IRecipeLayoutBuilder builder, MoldingRecipe recipe, IFocus
// if we have a mold, we are pressing into the table, so draw pressed item on input and output
Ingredient pattern = recipe.getPattern();
if (!pattern.isEmpty()) {
builder.addSlot(RecipeIngredientRole.INPUT, 3, 1).addIngredients(pattern);
IRecipeSlotBuilder inputSlot = builder.addSlot(RecipeIngredientRole.INPUT, 3, 1).addIngredients(pattern);
if (!recipe.isPatternConsumed()) {
builder.addSlot(RecipeIngredientRole.RENDER_ONLY, 51, 8).addIngredients(pattern);
IRecipeSlotBuilder preservedSlot = builder.addSlot(RecipeIngredientRole.RENDER_ONLY, 51, 8).addIngredients(pattern);
builder.createFocusLink(inputSlot, preservedSlot);
}
}
}
Expand Down

0 comments on commit 9277da8

Please sign in to comment.