Skip to content

Commit

Permalink
fix: find & replace getTickDelta with getTickProgress
Browse files Browse the repository at this point in the history
  • Loading branch information
DataM0del committed Feb 7, 2025
1 parent 3d8fa31 commit 87ad54c
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public abstract class MixinInGameHud {
*/
@Inject(method = "renderMainHud", at = @At("HEAD"))
private void hookRenderEventStart(DrawContext context, RenderTickCounter tickCounter, CallbackInfo ci) {
UiRenderer.INSTANCE.startUIOverlayDrawing(context, tickCounter.getTickDelta(false));
UiRenderer.INSTANCE.startUIOverlayDrawing(context, tickCounter.getTickProgress(false));

// Draw after overlay event
var component = ComponentOverlay.getComponentWithTweak(FeatureTweak.TWEAK_HOTBAR);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ public void hookWorldRender(RenderTickCounter tickCounter, CallbackInfo ci, @Loc

newMatStack.multiplyPositionMatrix(matrix4f2);

EventManager.INSTANCE.callEvent(new WorldRenderEvent(newMatStack, this.camera, tickCounter.getTickDelta(false)));
EventManager.INSTANCE.callEvent(new WorldRenderEvent(newMatStack, this.camera, tickCounter.getTickProgress(false)));
}

@Inject(method = "renderHand", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/render/LightmapTextureManager;enable()V", shift = At.Shift.AFTER))
Expand All @@ -161,7 +161,7 @@ public void drawItemCharms(Camera camera, float tickDelta, Matrix4f matrix4f, Ca
target = "Lnet/minecraft/client/gui/screen/Screen;renderWithTooltip(Lnet/minecraft/client/gui/DrawContext;IIF)V",
shift = At.Shift.AFTER))
public void hookScreenRender(RenderTickCounter tickCounter, boolean tick, CallbackInfo ci, @Local DrawContext drawContext) {
EventManager.INSTANCE.callEvent(new ScreenRenderEvent(drawContext, tickCounter.getTickDelta(false)));
EventManager.INSTANCE.callEvent(new ScreenRenderEvent(drawContext, tickCounter.getTickProgress(false)));
}

@Inject(method = "tiltViewWhenHurt", at = @At("HEAD"), cancellable = true)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ private void onRender(ObjectAllocator allocator, RenderTickCounter tickCounter,
outlineShader.update();
outlineShader.getHandle().get().beginWrite(false);

var event = new DrawOutlinesEvent(new MatrixStack(), camera, tickCounter.getTickDelta(false), DrawOutlinesEvent.OutlineType.INBUILT_OUTLINE);
var event = new DrawOutlinesEvent(new MatrixStack(), camera, tickCounter.getTickProgress(false), DrawOutlinesEvent.OutlineType.INBUILT_OUTLINE);
EventManager.INSTANCE.callEvent(event);

if (event.getDirtyFlag()) {
Expand Down Expand Up @@ -237,7 +237,7 @@ private void onRenderOutline(Fog fog, RenderTickCounter renderTickCounter, Camer

//noinspection DataFlowIssue
this.getEntityOutlinesFramebuffer().beginWrite(false);
var event = new DrawOutlinesEvent(new MatrixStack(), camera, renderTickCounter.getTickDelta(false), DrawOutlinesEvent.OutlineType.MINECRAFT_GLOW);
var event = new DrawOutlinesEvent(new MatrixStack(), camera, renderTickCounter.getTickProgress(false), DrawOutlinesEvent.OutlineType.MINECRAFT_GLOW);
EventManager.INSTANCE.callEvent(event);
OutlineFlag.drawOutline |= event.getDirtyFlag();
client.getFramebuffer().beginWrite(false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ object ModuleBreadcrumbs : ClientModule("Breadcrumbs", Category.RENDER, aliases
ObjectFloatMutablePair.of(point, alpha)
}

val interpolatedPos = entity.getLerpedPos(mc.renderTickCounter.getTickDelta(true))
val interpolatedPos = entity.getLerpedPos(mc.renderTickCounter.getTickProgress(true))
val point = calculatePoint(camera, interpolatedPos.x, interpolatedPos.y, interpolatedPos.z)
pointsWithAlpha.last().left(point)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class TrajectoryInfoRenderer(
entity: Entity,
trajectoryInfo: TrajectoryInfo,
rotation: Rotation,
partialTicks: Float = mc.renderTickCounter.getTickDelta(true)
partialTicks: Float = mc.renderTickCounter.getTickProgress(true)
): TrajectoryInfoRenderer {
val yawRadians = rotation.yaw / 180f * Math.PI.toFloat()
val pitchRadians = rotation.pitch / 180f * Math.PI.toFloat()
Expand Down

0 comments on commit 87ad54c

Please sign in to comment.