No item copy when swapping item hand

This commit is contained in:
Felix Cravic 2020-12-08 00:08:27 +01:00
parent 0de69ae2ad
commit 99f4c8f2d3

View File

@ -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());