Fix suspicious frame time code

This commit is contained in:
IMS212
2024-01-22 17:52:51 -08:00
parent 9b4276c29b
commit 200ad05f4c
3 changed files with 7 additions and 26 deletions
@@ -66,27 +66,6 @@ public class MixinLevelRenderer
{
@Shadow
private ClientLevel level;
@Unique
private static float previousPartialTicks = 0;
// Inject rendering at first call to renderChunkLayer
// HEAD or RETURN
#if MC_VER < MC_1_17_1
@Inject(at = @At("RETURN"), method = "renderSky(Lcom/mojang/blaze3d/vertex/PoseStack;F)V")
private void renderSky(PoseStack matrixStackIn, float partialTicks, CallbackInfo callback)
{
// get the partial ticks since renderBlockLayer doesn't
// have access to them
previousPartialTicks = partialTicks;
}
#else
@Inject(method = "renderClouds", at = @At("HEAD"), cancellable = true)
public void renderClouds(PoseStack poseStack, Matrix4f projectionMatrix, float tickDelta, double cameraX, double cameraY, double cameraZ, CallbackInfo ci) {
// get the partial ticks since renderChunkLayer doesn't
// have access to them
previousPartialTicks = tickDelta;
}
#endif
#if MC_VER < MC_1_17_1
@Inject(at = @At("HEAD"),
@@ -114,7 +93,7 @@ public class MixinLevelRenderer
ClientApi.INSTANCE.renderDeferredLods(ClientLevelWrapper.getWrapper(this.level),
McObjectConverter.Convert(modelViewMatrixStack.last().pose()),
McObjectConverter.Convert(projectionMatrix),
previousPartialTicks);
Minecraft.getInstance().getFrameTime());
}
// FIXME completely disables rendering when sodium is installed