File tree Expand file tree Collapse file tree
src/main/java/de/siphalor/mousewheelie/client/inventory Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -40,6 +40,7 @@ public class StackPicker {
4040 private static final int HOTBAR_INVENTORY_START_SLOT = 0 ;
4141 private static final int MAIN_INVENTORY_START_SLOT = Inventory .getSelectionSize ();
4242 private static final int HOTBAR_CONTAINER_START_SLOT = InventoryMenu .USE_ROW_SLOT_START ;
43+ private static final int HOTBAR_CONTAINER_END_SLOT = InventoryMenu .USE_ROW_SLOT_END ;
4344 private static final int MAIN_INVENTORY_CONTAINER_START_SLOT = InventoryMenu .INV_SLOT_START ;
4445
4546 private final Player player ;
@@ -199,7 +200,8 @@ private int findNextFreeHotbarInventorySlot() {
199200 }
200201
201202 private void swapWithTargetContainerSlot (int targetContainerSlot ) {
202- if (InventoryMenu .isHotbarSlot (targetContainerSlot )) {
203+ // InventoryMenu#isHotbarSlot for some reason includes the offhand slot
204+ if (targetContainerSlot >= HOTBAR_CONTAINER_START_SLOT && targetContainerSlot < HOTBAR_CONTAINER_END_SLOT ) {
203205 int hotbarSlot = targetContainerSlot - HOTBAR_CONTAINER_START_SLOT ;
204206 if (hotbarSlot != getSelectedHotbarSlot ()) {
205207 selectHotbarSlot (hotbarSlot );
You can’t perform that action at this time.
0 commit comments