mirror of
https://github.com/Minestom/Minestom.git
synced 2025-01-13 19:51:27 +01:00
No item copy when swapping item hand
This commit is contained in:
parent
0de69ae2ad
commit
99f4c8f2d3
@ -130,7 +130,7 @@ public class PlayerDiggingListener {
|
||||
|
||||
break;
|
||||
case SWAP_ITEM_HAND:
|
||||
PlayerSwapItemEvent swapItemEvent = new PlayerSwapItemEvent(player, offHand.copy(), mainHand.copy());
|
||||
PlayerSwapItemEvent swapItemEvent = new PlayerSwapItemEvent(player, offHand, mainHand);
|
||||
player.callCancellableEvent(PlayerSwapItemEvent.class, swapItemEvent, () -> {
|
||||
synchronized (playerInventory) {
|
||||
playerInventory.setItemInMainHand(swapItemEvent.getMainHandItem());
|
||||
|
Loading…
Reference in New Issue
Block a user