|
1 | 1 | package dev.thecodewarrior.hooked.mixin; |
2 | 2 |
|
3 | | -import com.teamwizardry.librarianlib.core.util.Client; |
4 | 3 | import dev.thecodewarrior.hooked.client.HookRenderManager; |
5 | | -import net.coderbot.iris.mixin.WorldRendererAccessor; |
6 | | -import net.minecraft.client.MinecraftClient; |
| 4 | +import net.coderbot.iris.pipeline.ShadowRenderer; |
7 | 5 | import net.minecraft.client.render.BufferBuilderStorage; |
8 | | -import net.minecraft.client.render.Camera; |
| 6 | +import net.minecraft.client.render.VertexConsumerProvider; |
9 | 7 | import net.minecraft.client.util.math.MatrixStack; |
10 | 8 | import org.spongepowered.asm.mixin.Final; |
11 | 9 | import org.spongepowered.asm.mixin.Mixin; |
12 | 10 | import org.spongepowered.asm.mixin.Shadow; |
13 | 11 | import org.spongepowered.asm.mixin.injection.At; |
14 | 12 | import org.spongepowered.asm.mixin.injection.Inject; |
15 | | -import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; |
| 13 | +import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; |
16 | 14 | import org.spongepowered.asm.mixin.injection.callback.LocalCapture; |
17 | 15 |
|
18 | | -@Mixin(targets = "net.coderbot.iris.pipeline.ShadowRenderer") |
| 16 | +@Mixin(ShadowRenderer.class) |
19 | 17 | public class IrisShadowRendererMixin { |
20 | 18 | @Shadow @Final private BufferBuilderStorage buffers; |
21 | 19 |
|
22 | 20 | @Inject( |
23 | | - method = "renderShadows", |
| 21 | + method = "renderBlockEntities", |
24 | 22 | at = @At( |
25 | 23 | value = "INVOKE_STRING", |
26 | | - target = "Lnet/minecraft/util/profiler/Profiler;swap(Ljava/lang/String;)V", |
| 24 | + target = "Lnet/minecraft/util/profiler/Profiler;push(Ljava/lang/String;)V", |
27 | 25 | args = {"ldc=build blockentities"} |
28 | 26 | ), |
29 | 27 | locals = LocalCapture.CAPTURE_FAILSOFT |
30 | 28 | ) |
31 | 29 | private void hooked$renderEntities( |
32 | | - WorldRendererAccessor worldRenderer, Camera playerCamera, |
33 | | - CallbackInfo ci, |
34 | | - MinecraftClient client, MatrixStack modelView |
| 30 | + VertexConsumerProvider.Immediate par1, MatrixStack modelView, double cameraX, double cameraY, double cameraZ, float tickDelta, boolean hasEntityFrustum, CallbackInfoReturnable<Integer> cir |
35 | 31 | ) { |
36 | | - var cameraPos = client.gameRenderer.getCamera().getPos(); |
37 | | - modelView.translate(-cameraPos.getX(), -cameraPos.getY(), -cameraPos.getZ()); |
38 | | - HookRenderManager.INSTANCE.renderHooks(modelView, Client.getMinecraft().getTickDelta(), buffers.getEntityVertexConsumers()); |
39 | | - modelView.translate(cameraPos.getX(), cameraPos.getY(), cameraPos.getZ()); |
| 32 | + modelView.translate(-cameraX, -cameraY, -cameraZ); |
| 33 | + HookRenderManager.INSTANCE.renderHooks(modelView, tickDelta, buffers.getEntityVertexConsumers()); |
| 34 | + modelView.translate(cameraX, cameraY, cameraZ); |
40 | 35 | } |
41 | 36 | } |
0 commit comments