summaryrefslogtreecommitdiffstats
path: root/nms-patches
diff options
context:
space:
mode:
authorBlackHole <black-hole@live.com>2016-03-08 19:00:23 +0100
committermd_5 <git@md-5.net>2016-03-09 07:44:39 +1100
commit5d90f9712bc86faee6015799c07058175c6d8323 (patch)
tree046cc5fcf21943c41b0257814257d088f10d4d64 /nms-patches
parent0705465a7551bcfcd88f87784f7cda8ad83fe4c0 (diff)
downloadcraftbukkit-5d90f9712bc86faee6015799c07058175c6d8323.tar
craftbukkit-5d90f9712bc86faee6015799c07058175c6d8323.tar.gz
craftbukkit-5d90f9712bc86faee6015799c07058175c6d8323.tar.lz
craftbukkit-5d90f9712bc86faee6015799c07058175c6d8323.tar.xz
craftbukkit-5d90f9712bc86faee6015799c07058175c6d8323.zip
SPIGOT-1845: Use correct hand for interact events
Diffstat (limited to 'nms-patches')
-rw-r--r--nms-patches/PlayerConnection.patch4
1 files changed, 2 insertions, 2 deletions
diff --git a/nms-patches/PlayerConnection.patch b/nms-patches/PlayerConnection.patch
index b5b451b2..8ce29079 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;
+ }
}