From 8717df0cbba7796fabb5d5e8d9a82d3268d2b015 Mon Sep 17 00:00:00 2001 From: miozune Date: Thu, 28 Apr 2022 22:46:01 +0900 Subject: [PATCH] Fix scrolling recipes when hovering over ingredients changes stack size (#237) --- src/main/java/codechicken/nei/NEIController.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/main/java/codechicken/nei/NEIController.java b/src/main/java/codechicken/nei/NEIController.java index 37f0745f..3c88a8ec 100644 --- a/src/main/java/codechicken/nei/NEIController.java +++ b/src/main/java/codechicken/nei/NEIController.java @@ -229,6 +229,11 @@ public class NEIController implements IContainerSlotClickHandler, IContainerInpu if (!NEIClientConfig.isEnabled() || GuiInfo.hasCustomSlots(gui) || !NEIClientConfig.isMouseScrollTransferEnabled()) return false; + // slot in GuiRecipe does not contain actual stack + // and scroll should be handled by GuiRecipe, not here + if (gui instanceof GuiRecipe) + return false; + Point mousePos = getMousePosition(); Slot mouseover = manager.window.getSlotAtPosition(mousePos.x, mousePos.y); if (mouseover != null && mouseover.getHasStack()) { @@ -239,9 +244,7 @@ public class NEIController implements IContainerSlotClickHandler, IContainerInpu fastTransferManager.transferItem(manager.window, mouseover.slotNumber); else fastTransferManager.retrieveItem(manager.window, mouseover.slotNumber); - // slot in GuiRecipe does not contain an actual stack - // and scroll should also be handled by GuiRecipe - return !(gui instanceof GuiRecipe); + return true; } return false; }