mirror of
https://github.com/Minestom/Minestom.git
synced 2025-01-02 14:38:26 +01:00
Fix cursor item not being set properly when inventory click event is cancelled
This commit is contained in:
parent
5b48a4f4cd
commit
063a4dc392
@ -66,8 +66,6 @@ public class WindowListener {
|
|||||||
successful = inventory.doubleClick(player, slot);
|
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
|
// Prevent ghost item when the click is cancelled
|
||||||
if (!successful) {
|
if (!successful) {
|
||||||
player.getInventory().update();
|
player.getInventory().update();
|
||||||
@ -75,6 +73,10 @@ public class WindowListener {
|
|||||||
((Inventory) inventory).update(player);
|
((Inventory) inventory).update(player);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Prevent the player from picking a ghost item in cursor
|
||||||
|
refreshCursorItem(player, inventory);
|
||||||
|
|
||||||
// (Why is the ping packet necessary?)
|
// (Why is the ping packet necessary?)
|
||||||
PingPacket pingPacket = new PingPacket();
|
PingPacket pingPacket = new PingPacket();
|
||||||
pingPacket.id = (1 << 30) | (windowId << 16);
|
pingPacket.id = (1 << 30) | (windowId << 16);
|
||||||
|
Loading…
Reference in New Issue
Block a user