From e51198bab851520ac8bed3fd4a6071c83512a7b4 Mon Sep 17 00:00:00 2001 From: luisc Date: Tue, 2 Apr 2024 15:32:55 -0500 Subject: [PATCH] Fixed animation data not working on players. --- .../noppes/npcs/controllers/data/AnimationData.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/java/noppes/npcs/controllers/data/AnimationData.java b/src/main/java/noppes/npcs/controllers/data/AnimationData.java index 08e8d29f9..577f7cc6a 100644 --- a/src/main/java/noppes/npcs/controllers/data/AnimationData.java +++ b/src/main/java/noppes/npcs/controllers/data/AnimationData.java @@ -45,11 +45,7 @@ public class AnimationData implements IAnimationData { public AnimationData(Object parent){ this.parent = parent; - if (parent instanceof DataDisplay) { - this.animationEntity = ((DataDisplay) parent).npc; - } else if (parent instanceof EntityPlayer) { - this.animationEntity = (EntityLivingBase) parent; - } + this.animationEntity = this.getMCEntity(); } public static AnimationData getData(Entity entity) { @@ -71,6 +67,10 @@ public class AnimationData implements IAnimationData { } public EntityLivingBase getMCEntity() { + if (this.animationEntity != null) { + return this.animationEntity; + } + if (this.parent instanceof DataDisplay) { return ((DataDisplay) this.parent).npc; } else {