diff --git a/build.gradle b/build.gradle index 70b80da..37c1e96 100644 --- a/build.gradle +++ b/build.gradle @@ -32,7 +32,7 @@ dependencies { minecraft "com.mojang:minecraft:${project.minecraft_version}" mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2" modImplementation "net.fabricmc:fabric-loader:${project.loader_version}" - modCompileOnly files("lib/iris-and-sodium-mc1.17-1.1.2+build.9.jar") + modCompileOnly files("lib/iris-mc1.19.2-1.5.2.jar") modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}" modImplementation "net.fabricmc:fabric-language-kotlin:${project.fabric_kotlin_version}" diff --git a/src/main/java/dev/thecodewarrior/hooked/mixin/IrisShadowRendererMixin.java b/src/main/java/dev/thecodewarrior/hooked/mixin/IrisShadowRendererMixin.java index dd769c4..e99b7d7 100644 --- a/src/main/java/dev/thecodewarrior/hooked/mixin/IrisShadowRendererMixin.java +++ b/src/main/java/dev/thecodewarrior/hooked/mixin/IrisShadowRendererMixin.java @@ -1,41 +1,36 @@ package dev.thecodewarrior.hooked.mixin; -import com.teamwizardry.librarianlib.core.util.Client; import dev.thecodewarrior.hooked.client.HookRenderManager; -import net.coderbot.iris.mixin.WorldRendererAccessor; -import net.minecraft.client.MinecraftClient; +import net.coderbot.iris.pipeline.ShadowRenderer; import net.minecraft.client.render.BufferBuilderStorage; -import net.minecraft.client.render.Camera; +import net.minecraft.client.render.VertexConsumerProvider; import net.minecraft.client.util.math.MatrixStack; import org.spongepowered.asm.mixin.Final; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Shadow; import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Inject; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; import org.spongepowered.asm.mixin.injection.callback.LocalCapture; -@Mixin(targets = "net.coderbot.iris.pipeline.ShadowRenderer") +@Mixin(ShadowRenderer.class) public class IrisShadowRendererMixin { @Shadow @Final private BufferBuilderStorage buffers; @Inject( - method = "renderShadows", + method = "renderBlockEntities", at = @At( value = "INVOKE_STRING", - target = "Lnet/minecraft/util/profiler/Profiler;swap(Ljava/lang/String;)V", + target = "Lnet/minecraft/util/profiler/Profiler;push(Ljava/lang/String;)V", args = {"ldc=build blockentities"} ), locals = LocalCapture.CAPTURE_FAILSOFT ) private void hooked$renderEntities( - WorldRendererAccessor worldRenderer, Camera playerCamera, - CallbackInfo ci, - MinecraftClient client, MatrixStack modelView + VertexConsumerProvider.Immediate par1, MatrixStack modelView, double cameraX, double cameraY, double cameraZ, float tickDelta, boolean hasEntityFrustum, CallbackInfoReturnable cir ) { - var cameraPos = client.gameRenderer.getCamera().getPos(); - modelView.translate(-cameraPos.getX(), -cameraPos.getY(), -cameraPos.getZ()); - HookRenderManager.INSTANCE.renderHooks(modelView, Client.getMinecraft().getTickDelta(), buffers.getEntityVertexConsumers()); - modelView.translate(cameraPos.getX(), cameraPos.getY(), cameraPos.getZ()); + modelView.translate(-cameraX, -cameraY, -cameraZ); + HookRenderManager.INSTANCE.renderHooks(modelView, tickDelta, buffers.getEntityVertexConsumers()); + modelView.translate(cameraX, cameraY, cameraZ); } }