diff --git a/src/main/java/codechicken/nei/recipe/GuiRecipeButton.java b/src/main/java/codechicken/nei/recipe/GuiRecipeButton.java index 31f4f0a3..4b2455ec 100644 --- a/src/main/java/codechicken/nei/recipe/GuiRecipeButton.java +++ b/src/main/java/codechicken/nei/recipe/GuiRecipeButton.java @@ -16,11 +16,15 @@ public abstract class GuiRecipeButton extends GuiNEIButton { public List buttonList; public RecipeHandlerRef handlerRef; + public int width; + public int height; - public UpdateRecipeButtonsEvent(GuiRecipe gui, RecipeHandlerRef handlerRef, + public UpdateRecipeButtonsEvent(GuiRecipe gui, RecipeHandlerRef handlerRef, int width, int height, List buttonList) { super(gui); this.handlerRef = handlerRef; + this.width = width; + this.height = height; this.buttonList = new ArrayList<>(buttonList); } @@ -29,16 +33,17 @@ public abstract class GuiRecipeButton extends GuiNEIButton { public HandlerInfo handlerInfo; - public Pre(GuiRecipe gui, RecipeHandlerRef handlerRef, HandlerInfo handlerInfo) { - super(gui, handlerRef, new ArrayList<>()); + public Pre(GuiRecipe gui, RecipeHandlerRef handlerRef, int width, int height, HandlerInfo handlerInfo) { + super(gui, handlerRef, width, height, new ArrayList<>()); this.handlerInfo = handlerInfo; } } public static class Post extends UpdateRecipeButtonsEvent { - public Post(GuiRecipe gui, RecipeHandlerRef handlerRef, List buttonList) { - super(gui, handlerRef, buttonList); + public Post(GuiRecipe gui, RecipeHandlerRef handlerRef, int width, int height, + List buttonList) { + super(gui, handlerRef, width, height, buttonList); } } } diff --git a/src/main/java/codechicken/nei/recipe/widget/RecipeWidget.java b/src/main/java/codechicken/nei/recipe/widget/RecipeWidget.java index 00120e97..ab88a10f 100644 --- a/src/main/java/codechicken/nei/recipe/widget/RecipeWidget.java +++ b/src/main/java/codechicken/nei/recipe/widget/RecipeWidget.java @@ -163,6 +163,8 @@ public class RecipeWidget extends Widget { final UpdateRecipeButtonsEvent.Pre preEvent = new UpdateRecipeButtonsEvent.Pre( guiRecipe, ref, + this.w, + this.h, this.handlerInfo); if (MinecraftForge.EVENT_BUS.post(preEvent)) { @@ -171,6 +173,8 @@ public class RecipeWidget extends Widget { final UpdateRecipeButtonsEvent.Post postEvent = new UpdateRecipeButtonsEvent.Post( guiRecipe, ref, + this.w, + this.h, getDefaultButtons(ref)); MinecraftForge.EVENT_BUS.post(postEvent); return postEvent.buttonList;