|
1 | 1 | package io.github.jumperonjava.customcursor.mixin; |
2 | 2 |
|
| 3 | +//? if !forge |
| 4 | +/*import com.llamalad7.mixinextras.sugar.Local;*/ |
3 | 5 | import io.github.jumperonjava.customcursor.CursorRenderer; |
4 | 6 | import net.minecraft.client.MinecraftClient; |
5 | 7 | import net.minecraft.client.gui.DrawContext; |
6 | 8 | import net.minecraft.client.render.GameRenderer; |
7 | 9 | import net.minecraft.client.render.RenderTickCounter; |
8 | 10 | import net.minecraft.client.util.Window; |
9 | 11 | import net.minecraft.client.util.math.MatrixStack; |
| 12 | +import net.minecraft.util.crash.CrashReport; |
| 13 | +import net.minecraft.util.crash.CrashReportSection; |
10 | 14 | import net.minecraft.util.profiler.Profiler; |
11 | 15 | import org.jetbrains.annotations.Nullable; |
12 | 16 | import org.joml.Matrix4f; |
|
22 | 26 | public class GameRendererMixin { |
23 | 27 | @Shadow @Nullable protected MinecraftClient client; |
24 | 28 |
|
25 | | - //? if < 1.21.3 |
26 | | - @Inject(method = "render",at = @At(value = "INVOKE", target = "Lnet/minecraft/util/profiler/Profiler;push(Ljava/lang/String;)V", ordinal = 1),locals = LocalCapture.CAPTURE_FAILSOFT) |
27 | 29 |
|
28 | | - //? if < 1.21 { |
29 | | - |
| 30 | + //? if = 1.20.1 { |
| 31 | + @Inject(method = "render",at = @At(value = "INVOKE", target = "Lnet/minecraft/util/profiler/Profiler;push(Ljava/lang/String;)V",ordinal = 1),locals = LocalCapture.CAPTURE_FAILHARD) |
30 | 32 | void renderCursor(float tickDelta, long startTime, boolean tick, CallbackInfo ci, int i, int j, Window window, Matrix4f matrix4f, MatrixStack matrixStack, DrawContext drawContext){ |
31 | 33 | CursorRenderer.render(drawContext,i,j,tickDelta); |
32 | 34 | } |
33 | | - //?} elif < 1.21.3 { |
34 | | - /*void renderCursor(RenderTickCounter tickCounter, boolean tick, CallbackInfo ci, boolean bl, int i, int j, Window window, Matrix4f matrix4f, Matrix4fStack matrix4fStack, DrawContext drawContext){ |
| 35 | + //?} elif = 1.20.4 { |
| 36 | + /*@Inject(method = "render", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/DrawContext;draw()V", shift = At.Shift.BEFORE)) |
| 37 | + void renderCursor(float tickDelta, long startTime, boolean tick, CallbackInfo ci, @Local(ordinal = 0) int i, @Local(ordinal = 1) int j, @Local DrawContext drawContext){ |
| 38 | + CursorRenderer.render(drawContext,i,j,tickDelta); |
| 39 | + } |
| 40 | + *///?} elif = 1.21.1 { |
| 41 | + |
| 42 | + /*@Inject(method = "render", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/DrawContext;draw()V", shift = At.Shift.BEFORE)) |
| 43 | + void renderCursor(RenderTickCounter tickCounter, boolean tick, CallbackInfo ci, @Local(ordinal = 0) int i, @Local(ordinal = 1) int j, @Local DrawContext drawContext){ |
35 | 44 | CursorRenderer.render(drawContext,i,j,tickCounter.getLastDuration()); |
36 | 45 | } |
37 | 46 | *///?} else { |
38 | | - /*@Inject(method = "render",at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/DrawContext;draw()V"),locals = LocalCapture.CAPTURE_FAILSOFT) |
39 | | - void renderCursor(RenderTickCounter tickCounter, boolean tick, CallbackInfo ci, Profiler profiler, boolean bl, int i, int j, Window window, Matrix4f matrix4f, Matrix4fStack matrix4fStack, DrawContext drawContext){ |
| 47 | + /*@Inject(method = "render", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/DrawContext;draw()V", shift = At.Shift.BEFORE)) |
| 48 | + void renderCursor(RenderTickCounter tickCounter, boolean tick, CallbackInfo ci, @Local(ordinal = 0) int i, @Local(ordinal = 1) int j, @Local DrawContext drawContext){ |
40 | 49 | CursorRenderer.render(drawContext,i,j,tickCounter.getLastDuration()); |
41 | 50 | } |
42 | 51 | *///?} |
|
0 commit comments