diff --git a/src/main/java/codechicken/nei/recipe/GuiRecipe.java b/src/main/java/codechicken/nei/recipe/GuiRecipe.java index 18c39102..ec0ce500 100644 --- a/src/main/java/codechicken/nei/recipe/GuiRecipe.java +++ b/src/main/java/codechicken/nei/recipe/GuiRecipe.java @@ -388,10 +388,10 @@ public abstract class GuiRecipe extends GuiContainer i // the value of the height field will be different from in other mouseover methods, which // could be confusing... - if (recipeTabs.mouseScrolled(i)) return; - for (int recipe : getRecipeIndices()) if (handler.mouseScrolled(this, i, recipe)) return; + if (recipeTabs.mouseScrolled(i)) return; + if (new Rectangle(guiLeft, guiTop, xSize, ySize).contains(GuiDraw.getMousePosition())) { if (i > 0) prevPage(); else nextPage(); diff --git a/src/main/java/codechicken/nei/recipe/GuiRecipeTabs.java b/src/main/java/codechicken/nei/recipe/GuiRecipeTabs.java index 4b6f7db5..8f285d16 100644 --- a/src/main/java/codechicken/nei/recipe/GuiRecipeTabs.java +++ b/src/main/java/codechicken/nei/recipe/GuiRecipeTabs.java @@ -198,14 +198,14 @@ public class GuiRecipeTabs { } protected boolean mouseScrolled(int i) { - Point mPos = getMousePosition(); + Point mousePosition = getMousePosition(); // Switch recipe handler tabs if either left shift is held or the tab // bar is enable and the mouse cursor is positioned over said tab bar. - if (Keyboard.isKeyDown(Keyboard.KEY_LSHIFT) - || (NEIClientConfig.areJEIStyleTabsVisible() && (mPos.x >= area.x && mPos.x <= (area.x + area.width) - && mPos.y >= area.y - && mPos.y <= (area.y + area.height)))) { + if (Keyboard.isKeyDown(Keyboard.KEY_LSHIFT) || (NEIClientConfig.areJEIStyleTabsVisible() + && (mousePosition.x >= area.x && mousePosition.x <= (area.x + area.width) + && mousePosition.y >= area.y + && mousePosition.y <= (area.y + area.height)))) { if (i < 0) guiRecipe.nextType(); else guiRecipe.prevType();