Fix ghost item when cancelling inventory click

This commit is contained in:
TheMode 2021-04-24 19:00:30 +02:00
parent 7d4e04bc66
commit 098a12961d

View File

@ -88,6 +88,14 @@ public class WindowListener {
// 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();
if (inventory != null) {
inventory.update(player);
}
}
WindowConfirmationPacket windowConfirmationPacket = new WindowConfirmationPacket();
windowConfirmationPacket.windowId = windowId;
windowConfirmationPacket.actionNumber = actionNumber;