From 5d90f9712bc86faee6015799c07058175c6d8323 Mon Sep 17 00:00:00 2001 From: BlackHole Date: Tue, 8 Mar 2016 19:00:23 +0100 Subject: [PATCH] SPIGOT-1845: Use correct hand for interact events --- nms-patches/PlayerConnection.patch | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nms-patches/PlayerConnection.patch b/nms-patches/PlayerConnection.patch index b5b451b225..8ce290791b 100644 --- a/nms-patches/PlayerConnection.patch +++ b/nms-patches/PlayerConnection.patch @@ -651,14 +651,14 @@ + + boolean cancelled = false; + if (movingobjectposition == null || movingobjectposition.type != MovingObjectPosition.EnumMovingObjectType.BLOCK) { -+ org.bukkit.event.player.PlayerInteractEvent event = CraftEventFactory.callPlayerInteractEvent(this.player, Action.RIGHT_CLICK_AIR, itemstack, EnumHand.MAIN_HAND); ++ org.bukkit.event.player.PlayerInteractEvent event = CraftEventFactory.callPlayerInteractEvent(this.player, Action.RIGHT_CLICK_AIR, itemstack, enumhand); + cancelled = event.useItemInHand() == Event.Result.DENY; + } else { + if (player.playerInteractManager.firedInteract) { + player.playerInteractManager.firedInteract = false; + cancelled = player.playerInteractManager.interactResult; + } else { -+ org.bukkit.event.player.PlayerInteractEvent event = CraftEventFactory.callPlayerInteractEvent(player, Action.RIGHT_CLICK_BLOCK, movingobjectposition.a(), movingobjectposition.direction, itemstack, true, EnumHand.MAIN_HAND); ++ org.bukkit.event.player.PlayerInteractEvent event = CraftEventFactory.callPlayerInteractEvent(player, Action.RIGHT_CLICK_BLOCK, movingobjectposition.a(), movingobjectposition.direction, itemstack, true, enumhand); + cancelled = event.useItemInHand() == Event.Result.DENY; + } }