prevent disabled slots from being scrolled fixes #3131

This commit is contained in:
Darkere
2021-11-22 19:01:01 +01:00
parent 1e6dcfa332
commit a5b5c7c296
2 changed files with 2 additions and 2 deletions

View File

@@ -336,7 +336,7 @@ public class GridContainer extends BaseContainer implements ICraftingGridListene
}
@Override
protected int getDisabledSlotNumber() {
public int getDisabledSlotNumber() {
return grid.getSlotId();
}

View File

@@ -584,7 +584,7 @@ public class GridScreen extends BaseScreen<GridContainer> implements IScreenInfo
doSort = !isOverSlotArea(x - guiLeft, y - guiTop) && !isOverCraftingOutputArea(x - guiLeft, y - guiTop);
}
if (grid.getGridType() != GridType.FLUID) {
if (isOverInventory(x - guiLeft, y - guiTop) && hoveredSlot != null && hoveredSlot.getHasStack()) {
if (isOverInventory(x - guiLeft, y - guiTop) && hoveredSlot != null && hoveredSlot.getHasStack() && getContainer().getDisabledSlotNumber() != hoveredSlot.getSlotIndex()) {
RS.NETWORK_HANDLER.sendToServer(new GridItemInventoryScrollMessage(hoveredSlot.getSlotIndex(), hasShiftDown(), delta > 0));
} else if (isOverSlotArea(x - guiLeft, y - guiTop)) {
RS.NETWORK_HANDLER.sendToServer(new GridItemGridScrollMessage(isOverSlotWithStack() ? view.getStacks().get(slotNumber).getId() : null, hasShiftDown(), delta > 0));