Revert Animation Events

This commit is contained in:
Kam committed 2024-05-26 19:26:47 -04:00
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;