mirror of
https://github.com/GTNewHorizons/NotEnoughItems.git
synced 2026-11-22 13:09:45 +00:00
Recipe Group Optimization (#1054)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
This commit is contained in:
1 parent
9f3697bb67
commit
a685efb3b7
11 files changed
+654
-214
No files matched your search
@@ -524,6 +524,13 @@ public abstract class GuiRecipe<H extends IRecipeHandler> extends GuiContainer i
|
||||
}
|
||||
|
||||
public int openTargetRecipe(RecipeId recipeId) {
|
||||
return openTargetRecipe(recipeId, null);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param pinnedIngredients when not null, the found recipe is paused with these ingredients shown
|
||||
*/
|
||||
public int openTargetRecipe(RecipeId recipeId, List<ItemStack> pinnedIngredients) {
|
||||
int recipeIndex = -1;
|
||||
int recipetype = 0;
|
||||
|
||||
@@ -551,6 +558,10 @@ public abstract class GuiRecipe<H extends IRecipeHandler> extends GuiContainer i
|
||||
setRecipePage(recipetype);
|
||||
this.handlerPages.gotoRecipeIndex(Math.max(0, recipeIndex));
|
||||
|
||||
if (pinnedIngredients != null && recipeIndex >= 0) {
|
||||
this.handlerPages.pinRecipe(recipeIndex, pinnedIngredients);
|
||||
}
|
||||
|
||||
return recipeIndex;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user