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