From 043b52ae51dcdf40c06123b236c69e5e9a3d0d89 Mon Sep 17 00:00:00 2001 From: Kam Date: Fri, 29 Mar 2024 02:49:52 -0400 Subject: [PATCH] Swing Packet only on Server Side --- src/main/java/noppes/npcs/entity/EntityNPCInterface.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/noppes/npcs/entity/EntityNPCInterface.java b/src/main/java/noppes/npcs/entity/EntityNPCInterface.java index 2d53a7495..a47a67cca 100644 --- a/src/main/java/noppes/npcs/entity/EntityNPCInterface.java +++ b/src/main/java/noppes/npcs/entity/EntityNPCInterface.java @@ -283,15 +283,15 @@ public abstract class EntityNPCInterface extends EntityCreature implements IEnti } if (!this.isSwingInProgress || this.swingProgressInt >= this.getArmSwingAnimationEnd() / 2 || this.swingProgressInt < 0) { - NpcEvent.SwingEvent event = new NpcEvent.SwingEvent(wrappedNPC, stack); - if(EventHooks.onNPCMeleeSwing(this, event)) - return; - this.swingProgressInt = -1; this.isSwingInProgress = true; if (this.worldObj instanceof WorldServer) { + NpcEvent.SwingEvent event = new NpcEvent.SwingEvent(wrappedNPC, stack); + if(EventHooks.onNPCMeleeSwing(this, event)) + return; + ((WorldServer)this.worldObj).getEntityTracker().func_151247_a(this, new S0BPacketAnimation(this, 0)); } }