Removed "render ticks" tick type. Instead, animations and frames can define a tick speed measured in milliseconds. Animations/frames using MC tick type will be 50ms (1000ms/20), and render ticks 20ms.

This commit is contained in:
luisc committed 2024-03-23 23:34:01 -05:00
1 parent de909472b3
commit 799631eece
11 files changed
+97 -95

No files matched your search

@@ -123,35 +123,9 @@ 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;