mirror of
https://github.com/PaperMC/Paper.git
synced 2025-02-10 17:42:16 +01:00
SPIGOT-1845: Use correct hand for interact events
By: BlackHole <black-hole@live.com>
This commit is contained in:
parent
9357e77b84
commit
cfc9d7d858
@ -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;
|
||||
+ }
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user