Add flag to control the arm swing when updating npc (#106)

* fancynpcs: Add overloaded update and updateForAll methods to skip swing animation.

* fancynpcs: remove unnecessary changes to other calls of update(player).

* Revert version change

* fancynpcs: pull default update(Player) method out to NPC class, and make non-abstract.

* fancynpcs: make swinging arm default update behavior.
This commit is contained in:
Phoenic
2025-09-17 13:47:48 -05:00
committed by GitHub
parent d8f1a4ecae
commit 061d2fa42d
11 changed files with 32 additions and 25 deletions

View File

@@ -208,9 +208,8 @@ public class Npc_1_21_5 extends Npc {
ClientboundRotateHeadPacket rotateHeadPacket = new ClientboundRotateHeadPacket(npc, (byte) (location.getYaw() * angelMultiplier));
serverPlayer.connection.send(rotateHeadPacket);
}
@Override
public void update(Player player) {
public void update(Player player, boolean swingArm) {
if (npc == null) {
return;
}
@@ -288,7 +287,7 @@ public class Npc_1_21_5 extends Npc {
refreshEntityData(player);
if (data.isSpawnEntity() && data.getLocation() != null) {
move(player, true);
move(player, swingArm);
}
NpcAttribute playerPoseAttr = FancyNpcsPlugin.get().getAttributeManager().getAttributeByName(org.bukkit.entity.EntityType.PLAYER, "pose");