Fixed thread crash when clicking in a non interactive inventory slot (-1)

This commit is contained in:
themode 2020-12-15 05:47:18 +01:00
parent e1a886aa3a
commit bf10f0d3f7
2 changed files with 7 additions and 2 deletions

View File

@ -301,8 +301,8 @@ public class PlayerInventory implements InventoryModifier, InventoryClickHandler
// Refresh slot
update();
//problem with ghost item when clicking on a slot which has a different internal id
//refreshSlot(slot);
// FIXME: replace update() to refreshSlot, currently not possible because our inventory click handling is not exactly the same as what the client expects
//refreshSlot((short) slot);
}
protected void setItemStackInternal(int slot, ItemStack itemStack) {

View File

@ -32,6 +32,11 @@ public class WindowListener {
boolean successful = false;
// prevent click in a non interactive slot (why does it exist?)
if (slot == -1) {
return;
}
switch (mode) {
case 0:
switch (button) {