Add PlayerArmSwingEvent

This commit is contained in:
Jake Potrebic 2021-03-12 19:22:21 -08:00
parent 39716421ea
commit 485db97ad6

View file

@ -1605,7 +1605,7 @@
+ } // Paper end - Call interact event
+
+ // Arm swing animation
+ PlayerAnimationEvent event = new PlayerAnimationEvent(this.getCraftPlayer(), (packet.getHand() == InteractionHand.MAIN_HAND) ? PlayerAnimationType.ARM_SWING : PlayerAnimationType.OFF_ARM_SWING);
+ io.papermc.paper.event.player.PlayerArmSwingEvent event = new io.papermc.paper.event.player.PlayerArmSwingEvent(this.getCraftPlayer(), org.bukkit.craftbukkit.CraftEquipmentSlot.getHand(packet.getHand())); // Paper - Add PlayerArmSwingEvent
+ this.cserver.getPluginManager().callEvent(event);
+
+ if (event.isCancelled()) return;