mirror of
https://github.com/Minestom/Minestom.git
synced 2025-01-28 11:01:35 +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;
|
break;
|
||||||
case SWAP_ITEM_HAND:
|
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, () -> {
|
player.callCancellableEvent(PlayerSwapItemEvent.class, swapItemEvent, () -> {
|
||||||
synchronized (playerInventory) {
|
synchronized (playerInventory) {
|
||||||
playerInventory.setItemInMainHand(swapItemEvent.getMainHandItem());
|
playerInventory.setItemInMainHand(swapItemEvent.getMainHandItem());
|
||||||
|
Loading…
Reference in New Issue
Block a user