Fix crash on shift scroll up on servers (#2708)

* fix server crash on shift scroll up

* don't compare quantity

* newline o.o

* changelog
This commit is contained in:
Darkere
2020-10-15 12:46:19 +02:00
committed by GitHub
parent 37dfa3f627
commit e08cc845a2
2 changed files with 8 additions and 3 deletions

View File

@@ -1,5 +1,8 @@
# Refined Storage Changelog # Refined Storage Changelog
### 1.9.8
- Fixed server crash when scrolling in Grid (Darkere)
### 1.9.7 ### 1.9.7
- Added functionality to move items in the Grid with shift/ctrl + scrolling (Darkere) - Added functionality to move items in the Grid with shift/ctrl + scrolling (Darkere)
- Changed JEI transfer error mechanics (raoulvdberge) - Changed JEI transfer error mechanics (raoulvdberge)

View File

@@ -321,9 +321,11 @@ public class ItemGridHandler implements IItemGridHandler {
return; return;
} }
int slot = player.inventory.getSlotFor(cache.getList().get(id)); for (int i = 0; i < player.inventory.mainInventory.size(); i++) {
if (slot != -1) { if (API.instance().getComparer().isEqual(player.inventory.getStackInSlot(i), cache.getList().get(id), IComparer.COMPARE_NBT)) {
gridHandler.onInsert(player, player.inventory.getStackInSlot(slot), true); gridHandler.onInsert(player, player.inventory.getStackInSlot(i), true);
break;
}
} }
} else { //scroll down, extract hovering item } else { //scroll down, extract hovering item