diff --git a/src/main/java/codechicken/nei/BookmarkPanel.java b/src/main/java/codechicken/nei/BookmarkPanel.java index 0eb1a0062..e449773d2 100644 --- a/src/main/java/codechicken/nei/BookmarkPanel.java +++ b/src/main/java/codechicken/nei/BookmarkPanel.java @@ -2109,6 +2109,9 @@ protected ItemStack getDraggedStackWithQuantity(int mouseDownSlot) { @Override public void mouseDragged(int mousex, int mousey, int button, long heldTime) { + if (mouseDownSlot >= grid.realItems.size()) { + mouseDownSlot = -1; + } if (this.groupingItem != null) { final int overRowIndex = (mousey - grid.marginTop) / BookmarkGrid.SLOT_SIZE; @@ -2241,8 +2244,7 @@ public void mouseDragged(int mousex, int mousey, int button, long heldTime) { if (button == 0 && NEIClientUtils.shiftKey() && mouseDownSlot >= 0 && this.sortableItem == null) { ItemPanelSlot mouseOverSlot = getSlotMouseOver(mousex, mousey); - if (grid.getItem(mouseDownSlot) != null - && (mouseOverSlot == null || mouseOverSlot.slotIndex != mouseDownSlot || heldTime > 250)) { + if (mouseOverSlot == null || mouseOverSlot.slotIndex != mouseDownSlot || heldTime > 250) { final BookmarkGrid BGrid = (BookmarkGrid) grid; final ItemStackMetadata meta = BGrid.getMetadata(mouseDownSlot); final List items = new ArrayList<>(); diff --git a/src/main/java/codechicken/nei/PanelWidget.java b/src/main/java/codechicken/nei/PanelWidget.java index c48fe7e92..9c5774688 100644 --- a/src/main/java/codechicken/nei/PanelWidget.java +++ b/src/main/java/codechicken/nei/PanelWidget.java @@ -200,6 +200,10 @@ public void postDraw(int mousex, int mousey) { @Override public void mouseDragged(int mousex, int mousey, int button, long heldTime) { + if (mouseDownSlot >= grid.realItems.size()) { + mouseDownSlot = -1; + } + if (mouseDownSlot >= 0 && draggedStack == null && NEIClientUtils.getHeldItem() == null && NEIClientConfig.hasSMPCounterPart()) {