mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-12 03:47:27 +00:00
Fixes to servers not ticking animations correctly on the server-side.
This commit is contained in:
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);
|
||||
|
||||
Reference in new issue
Block a user