SPIGOT-7003: Add missing PlayerAnimationType

This commit is contained in:
Doc 2022-06-09 21:30:25 +10:00 committed by md_5
parent 0dcc5fdd0d
commit 576a037044
No known key found for this signature in database
GPG Key ID: E8E901AC7C617C11

View File

@ -11,7 +11,6 @@
+import net.minecraft.network.protocol.game.PacketPlayOutEntityMetadata; +import net.minecraft.network.protocol.game.PacketPlayOutEntityMetadata;
+import net.minecraft.network.protocol.game.PacketPlayOutSpawnEntity; +import net.minecraft.network.protocol.game.PacketPlayOutSpawnEntity;
+import net.minecraft.network.protocol.game.PacketPlayOutSpawnPosition; +import net.minecraft.network.protocol.game.PacketPlayOutSpawnPosition;
+import net.minecraft.util.MathHelper;
+import net.minecraft.world.entity.EntityInsentient; +import net.minecraft.world.entity.EntityInsentient;
+import net.minecraft.world.entity.animal.Bucketable; +import net.minecraft.world.entity.animal.Bucketable;
+import net.minecraft.world.entity.EntityLiving; +import net.minecraft.world.entity.EntityLiving;
@ -41,6 +40,7 @@
+import org.bukkit.event.inventory.SmithItemEvent; +import org.bukkit.event.inventory.SmithItemEvent;
+import org.bukkit.event.player.AsyncPlayerChatEvent; +import org.bukkit.event.player.AsyncPlayerChatEvent;
+import org.bukkit.event.player.PlayerAnimationEvent; +import org.bukkit.event.player.PlayerAnimationEvent;
+import org.bukkit.event.player.PlayerAnimationType;
+import org.bukkit.event.player.PlayerChatEvent; +import org.bukkit.event.player.PlayerChatEvent;
+import org.bukkit.event.player.PlayerCommandPreprocessEvent; +import org.bukkit.event.player.PlayerCommandPreprocessEvent;
+import org.bukkit.event.player.PlayerInteractAtEntityEvent; +import org.bukkit.event.player.PlayerInteractAtEntityEvent;
@ -1158,7 +1158,7 @@
+ } + }
+ +
+ // Arm swing animation + // Arm swing animation
+ PlayerAnimationEvent event = new PlayerAnimationEvent(this.getCraftPlayer()); + PlayerAnimationEvent event = new PlayerAnimationEvent(this.getCraftPlayer(), (packetplayinarmanimation.getHand() == EnumHand.MAIN_HAND) ? PlayerAnimationType.ARM_SWING : PlayerAnimationType.OFF_ARM_SWING);
+ this.cserver.getPluginManager().callEvent(event); + this.cserver.getPluginManager().callEvent(event);
+ +
+ if (event.isCancelled()) return; + if (event.isCancelled()) return;