mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-11 21:57:40 +00:00
Animation fixes, temporarily removed caching.
This commit is contained in:
1 parent
572077b7e5
commit
34d002191e
3 files changed
+28
-24
No files matched your search
@@ -491,12 +491,28 @@ public class ServerEventsHandler {
|
||||
|
||||
@SubscribeEvent
|
||||
public void playerTracking(PlayerEvent.StartTracking event){
|
||||
if(!(event.target instanceof EntityNPCInterface) || event.target.worldObj.isRemote)
|
||||
if(!(event.target instanceof EntityPlayerMP || event.target instanceof EntityNPCInterface) || event.target.worldObj.isRemote)
|
||||
return;
|
||||
|
||||
MarkData data = MarkData.get((EntityNPCInterface) event.target);
|
||||
if(data.marks.isEmpty())
|
||||
return;
|
||||
Server.sendData((EntityPlayerMP)event.entityPlayer, EnumPacketClient.MARK_DATA, event.target.getEntityId(), data.getNBT());
|
||||
AnimationData animationData = AnimationData.getData(event.target);
|
||||
if (animationData.isClientAnimating()) {
|
||||
AnimationData playerAnimData = AnimationData.getData(event.entityPlayer);
|
||||
Animation currentAnimation = animationData.currentClientAnimation;
|
||||
NBTTagCompound compound = currentAnimation.writeToNBT();
|
||||
|
||||
if (playerAnimData.viewAnimation(currentAnimation, animationData, compound,
|
||||
animationData.isClientAnimating(), currentAnimation.currentFrame, currentAnimation.currentFrameTime)) {
|
||||
synchronized (CommonProxy.serverPlayingAnimations) {
|
||||
CommonProxy.serverPlayingAnimations.add(animationData);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (event.target instanceof EntityNPCInterface) {
|
||||
MarkData data = MarkData.get((EntityNPCInterface) event.target);
|
||||
if (data.marks.isEmpty())
|
||||
return;
|
||||
Server.sendData((EntityPlayerMP) event.entityPlayer, EnumPacketClient.MARK_DATA, event.target.getEntityId(), data.getNBT());
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user