Merge pull request #441 from iam4722202468/master

Fix cursor item not being set properly when inventory click event is cancelled
This commit is contained in:
TheMode 2021-08-31 09:50:49 +02:00 committed by GitHub
commit 6f3897bdfd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -66,8 +66,6 @@ public class WindowListener {
successful = inventory.doubleClick(player, slot);
}
// Prevent the player from picking a ghost item in cursor
refreshCursorItem(player, inventory);
// Prevent ghost item when the click is cancelled
if (!successful) {
player.getInventory().update();
@ -75,6 +73,10 @@ public class WindowListener {
((Inventory) inventory).update(player);
}
}
// Prevent the player from picking a ghost item in cursor
refreshCursorItem(player, inventory);
// (Why is the ping packet necessary?)
PingPacket pingPacket = new PingPacket();
pingPacket.id = (1 << 30) | (windowId << 16);