diff --git a/fabric/src/main/java/com/seibel/distanthorizons/fabric/mixins/client/MixinGameRenderer.java b/fabric/src/main/java/com/seibel/distanthorizons/fabric/mixins/client/MixinGameRenderer.java
new file mode 100644
index 000000000..37b1ef5f5
--- /dev/null
+++ b/fabric/src/main/java/com/seibel/distanthorizons/fabric/mixins/client/MixinGameRenderer.java
@@ -0,0 +1,70 @@
+/*
+ * This file is part of the Distant Horizons mod
+ * licensed under the GNU LGPL v3 License.
+ *
+ * Copyright (C) 2020 James Seibel
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
+ */
+
+package com.seibel.distanthorizons.fabric.mixins.client;
+
+#if MC_VER <= MC_1_21_11
+#else
+import com.mojang.blaze3d.vertex.PoseStack;
+import com.seibel.distanthorizons.common.wrappers.McObjectConverter;
+import com.seibel.distanthorizons.core.api.internal.ClientApi;
+import net.minecraft.client.DeltaTracker;
+import net.minecraft.client.player.LocalPlayer;
+import net.minecraft.client.renderer.GameRenderer;
+import net.minecraft.client.renderer.state.OptionsRenderState;
+import net.minecraft.client.renderer.state.level.CameraRenderState;
+import net.minecraft.util.profiling.ProfilerFiller;
+import org.joml.Matrix4f;
+import org.joml.Matrix4fc;
+import org.spongepowered.asm.mixin.Mixin;
+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.LocalCapture;
+
+@Mixin(GameRenderer.class)
+public class MixinGameRenderer
+{
+ @Inject(
+ method = "renderLevel",
+ at = @At(
+ value = "INVOKE",
+ target = "Lcom/mojang/blaze3d/systems/RenderSystem;setProjectionMatrix(Lcom/mojang/blaze3d/buffers/GpuBufferSlice;Lcom/mojang/blaze3d/ProjectionType;)V",
+ shift = At.Shift.BEFORE
+ ),
+ locals = LocalCapture.CAPTURE_FAILHARD
+ )
+ private void renderLevel(
+ final DeltaTracker deltaTracker,
+ final CallbackInfo callback,
+ final float partialTickTime,
+ final float cameraEntityPartialTicks,
+ final LocalPlayer player,
+ final ProfilerFiller profiler,
+ final boolean renderBlockOutline,
+ final OptionsRenderState options,
+ final CameraRenderState camera,
+ final Matrix4fc modelViewMatrix,
+ final Matrix4f projectionMatrix,
+ final PoseStack poseStack)
+ {
+ ClientApi.RENDER_STATE.mcProjectionMatrix = McObjectConverter.Convert(projectionMatrix);
+ }
+}
+#endif
diff --git a/fabric/src/main/java/com/seibel/distanthorizons/fabric/mixins/client/MixinLevelRenderer.java b/fabric/src/main/java/com/seibel/distanthorizons/fabric/mixins/client/MixinLevelRenderer.java
index 425bd2191..389a3a120 100644
--- a/fabric/src/main/java/com/seibel/distanthorizons/fabric/mixins/client/MixinLevelRenderer.java
+++ b/fabric/src/main/java/com/seibel/distanthorizons/fabric/mixins/client/MixinLevelRenderer.java
@@ -237,7 +237,6 @@ public class MixinLevelRenderer
CallbackInfo callback)
{
ClientApi.RENDER_STATE.mcModelViewMatrix = McObjectConverter.Convert(modelViewMatrix);
- ClientApi.RENDER_STATE.mcProjectionMatrix = McObjectConverter.Convert(camera.projectionMatrix);
ClientApi.RENDER_STATE.partialTickTime = MinecraftRenderWrapper.INSTANCE.getPartialTickTime();
diff --git a/fabric/src/main/resources/DistantHorizons.fabric.mixins.json b/fabric/src/main/resources/DistantHorizons.fabric.mixins.json
index 92f07d61c..1339e0f7a 100644
--- a/fabric/src/main/resources/DistantHorizons.fabric.mixins.json
+++ b/fabric/src/main/resources/DistantHorizons.fabric.mixins.json
@@ -16,6 +16,7 @@
"client.MixinClientPacketListener",
"client.MixinDebugScreenOverlay",
"client.MixinFogRenderer",
+ "client.MixinGameRenderer",
"client.MixinLevelRenderer",
"client.MixinChunkSectionsToRender",
"client.MixinLightTexture",
diff --git a/neoforge/src/main/java/com/seibel/distanthorizons/neoforge/mixins/client/MixinGameRenderer.java b/neoforge/src/main/java/com/seibel/distanthorizons/neoforge/mixins/client/MixinGameRenderer.java
new file mode 100644
index 000000000..854ad56f9
--- /dev/null
+++ b/neoforge/src/main/java/com/seibel/distanthorizons/neoforge/mixins/client/MixinGameRenderer.java
@@ -0,0 +1,70 @@
+/*
+ * This file is part of the Distant Horizons mod
+ * licensed under the GNU LGPL v3 License.
+ *
+ * Copyright (C) 2020 James Seibel
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
+ */
+
+package com.seibel.distanthorizons.neoforge.mixins.client;
+
+#if MC_VER <= MC_1_21_11
+#else
+import com.mojang.blaze3d.vertex.PoseStack;
+import com.seibel.distanthorizons.common.wrappers.McObjectConverter;
+import com.seibel.distanthorizons.core.api.internal.ClientApi;
+import net.minecraft.client.DeltaTracker;
+import net.minecraft.client.player.LocalPlayer;
+import net.minecraft.client.renderer.GameRenderer;
+import net.minecraft.client.renderer.state.OptionsRenderState;
+import net.minecraft.client.renderer.state.level.CameraRenderState;
+import net.minecraft.util.profiling.ProfilerFiller;
+import org.joml.Matrix4f;
+import org.joml.Matrix4fc;
+import org.spongepowered.asm.mixin.Mixin;
+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.LocalCapture;
+
+@Mixin(GameRenderer.class)
+public class MixinGameRenderer
+{
+ @Inject(
+ method = "renderLevel",
+ at = @At(
+ value = "INVOKE",
+ target = "Lcom/mojang/blaze3d/systems/RenderSystem;setProjectionMatrix(Lcom/mojang/blaze3d/buffers/GpuBufferSlice;Lcom/mojang/blaze3d/ProjectionType;)V",
+ shift = At.Shift.BEFORE
+ ),
+ locals = LocalCapture.CAPTURE_FAILHARD
+ )
+ private void renderLevel(
+ final DeltaTracker deltaTracker,
+ final CallbackInfo callback,
+ final float partialTickTime,
+ final float cameraEntityPartialTicks,
+ final LocalPlayer player,
+ final ProfilerFiller profiler,
+ final boolean renderBlockOutline,
+ final OptionsRenderState options,
+ final CameraRenderState camera,
+ final Matrix4fc modelViewMatrix,
+ final Matrix4f projectionMatrix,
+ final PoseStack poseStack)
+ {
+ ClientApi.RENDER_STATE.mcProjectionMatrix = McObjectConverter.Convert(projectionMatrix);
+ }
+}
+#endif
diff --git a/neoforge/src/main/java/com/seibel/distanthorizons/neoforge/mixins/client/MixinLevelRenderer.java b/neoforge/src/main/java/com/seibel/distanthorizons/neoforge/mixins/client/MixinLevelRenderer.java
index 58681a496..0fd3e7436 100644
--- a/neoforge/src/main/java/com/seibel/distanthorizons/neoforge/mixins/client/MixinLevelRenderer.java
+++ b/neoforge/src/main/java/com/seibel/distanthorizons/neoforge/mixins/client/MixinLevelRenderer.java
@@ -218,7 +218,6 @@ public class MixinLevelRenderer
CallbackInfo callback)
{
ClientApi.RENDER_STATE.mcModelViewMatrix = McObjectConverter.Convert(modelViewMatrix);
- ClientApi.RENDER_STATE.mcProjectionMatrix = McObjectConverter.Convert(camera.projectionMatrix);
ClientApi.RENDER_STATE.partialTickTime = MinecraftRenderWrapper.INSTANCE.getPartialTickTime();
diff --git a/neoforge/src/main/resources/DistantHorizons.neoforge.mixins.json b/neoforge/src/main/resources/DistantHorizons.neoforge.mixins.json
index b4f85ecb1..eeb186623 100644
--- a/neoforge/src/main/resources/DistantHorizons.neoforge.mixins.json
+++ b/neoforge/src/main/resources/DistantHorizons.neoforge.mixins.json
@@ -15,6 +15,7 @@
"client.MixinClientPacketListener",
"client.MixinDebugScreenOverlay",
"client.MixinFogRenderer",
+ "client.MixinGameRenderer",
"client.MixinLevelRenderer",
"client.MixinLightTexture",
"client.MixinMinecraft",