mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-18 12:39:05 +00:00
Revert Animation Events
This commit is contained in:
1 parent
4c46496c82
commit
1ffddd3ce9
31 files changed
+208
-696
No files matched your search
@@ -129,9 +129,35 @@ public class ClientEventHandler {
|
||||
ClientEventHandler.playerModel = null;
|
||||
}
|
||||
|
||||
if (data != null && data.isActive() && !Minecraft.getMinecraft().isGamePaused()) {
|
||||
Animation animation = data.animation;
|
||||
if (data.isActive() && animation.currentFrame().useRenderTicks()) {
|
||||
animation.increaseTime();
|
||||
}
|
||||
}
|
||||
|
||||
ClientEventHandler.renderingNpc = null;
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onUpdateEntity(LivingEvent.LivingUpdateEvent event) {
|
||||
if (FMLCommonHandler.instance().getEffectiveSide() == Side.CLIENT) {
|
||||
AnimationData data = null;
|
||||
if (event.entity instanceof EntityNPCInterface) {
|
||||
data = ((EntityNPCInterface) event.entity).display.animationData;
|
||||
} else if (event.entity instanceof EntityPlayer && ClientCacheHandler.playerAnimations.containsKey(event.entity.getUniqueID())) {
|
||||
data = ClientCacheHandler.playerAnimations.get(event.entity.getUniqueID());
|
||||
}
|
||||
|
||||
if (data != null && data.isActive()) {
|
||||
Animation animation = data.animation;
|
||||
if (data.isActive() && !animation.currentFrame().useRenderTicks()) {
|
||||
animation.increaseTime();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onRenderPlayer(RenderPlayerEvent.Pre event) {
|
||||
ClientEventHandler.renderingPlayer = event.entityPlayer;
|
||||
|
||||
Reference in new issue
Block a user