Fix scrolling recipes when hovering over ingredients changes stack size (#237)

This commit is contained in:
miozune authored and GitHub committed 2022-04-28 15:46:01 +02:00
1 parent d6a6551561
commit 8717df0cbb
1 file changed
+6 -3
@@ -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;
}