Reapply "Revert Animation Events"

This reverts commit 4113bcc6e9.
This commit is contained in:
Kam committed 2024-08-22 16:47:45 -04:00
1 parent 22169c81a0
commit 934cc3d7cd
31 files changed
+206 -694

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;