diff --git a/src/main/java/codechicken/nei/BookmarkPanel.java b/src/main/java/codechicken/nei/BookmarkPanel.java index df7dec30c..0ab98d07a 100644 --- a/src/main/java/codechicken/nei/BookmarkPanel.java +++ b/src/main/java/codechicken/nei/BookmarkPanel.java @@ -217,7 +217,9 @@ public static class BookmarkGrid extends ItemsGrid { private static class RecipeTooltipRenderer { - public int slotIndex = 0; + public ItemStack stack = null; + public BookmarkRecipeId recipeId = null; + public GuiRecipe gui = null; public Runnable createRecipeGui = null; } @@ -1071,16 +1073,17 @@ private void drawRecipeTooltip(int mousex, int mousey, List itemTooltip) return; } - if (this.recipeTooltipRenderer == null || this.recipeTooltipRenderer.slotIndex != focused.slotIndex) { - + if (this.recipeTooltipRenderer == null || this.recipeTooltipRenderer.recipeId != meta.recipeId) { this.recipeTooltipRenderer = new RecipeTooltipRenderer(); - this.recipeTooltipRenderer.slotIndex = focused.slotIndex; + this.recipeTooltipRenderer.stack = this.realItems.get(focused.slotIndex); + this.recipeTooltipRenderer.recipeId = meta.recipeId; this.recipeTooltipRenderer.createRecipeGui = () -> { - final int slotIndex = this.recipeTooltipRenderer.slotIndex; - final BookmarkRecipeId recipeId = this.metadata.get(slotIndex).recipeId; - GuiRecipe gui = GuiCraftingRecipe - .createRecipeGui("recipeId", false, this.realItems.get(slotIndex), recipeId); + GuiRecipe gui = GuiCraftingRecipe.createRecipeGui( + "recipeId", + false, + this.recipeTooltipRenderer.stack, + this.recipeTooltipRenderer.recipeId); if (gui != null) { gui.initGui();