Fixes to servers not ticking animations correctly on the server-side.

This commit is contained in:
luisc committed 2024-04-02 15:26:55 -05:00
1 parent 403b6c5d32
commit d2a189ac3a
1 file changed
+7 -6
@@ -110,6 +110,13 @@ public class AnimationData implements IAnimationData {
EventHooks.onAnimationFrameEntered(this.animation, this.animation.currentFrame());
}
synchronized (CommonProxy.serverPlayingAnimations) {
if (this.isClientAnimating && this.animationEntity != null &&
!this.animationEntity.worldObj.isRemote && this.animation != null) {
CommonProxy.serverPlayingAnimations.add(this.animation);
}
}
List<EntityPlayer> entities = sendingEntity.worldObj.getEntitiesWithinAABB(EntityPlayer.class, AxisAlignedBB.getBoundingBox(
sendingEntity.posX - range, sendingEntity.posY - range, sendingEntity.posZ - range,
sendingEntity.posX + range, sendingEntity.posY + range, sendingEntity.posZ + range));
@@ -187,12 +194,6 @@ public class AnimationData implements IAnimationData {
NBTTagCompound data = animationData.viewWriteNBT(new NBTTagCompound());
animationData.allowAnimation = prevEnabled;
synchronized (CommonProxy.serverPlayingAnimations) {
if (animationData.animationEntity != null && !animationData.animationEntity.worldObj.isRemote && animation != null) {
CommonProxy.serverPlayingAnimations.add(animation);
}
}
if (animation != null && currentFrame >= 0 && currentFrame < animation.frames.size()) {
data.setInteger("Frame", currentFrame);
data.setInteger("Time", time);