aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/makamys/lodmod/mixin/MixinRenderGlobal.java
diff options
context:
space:
mode:
authormakamys <makamys@outlook.com>2021-05-10 15:00:09 +0200
committermakamys <makamys@outlook.com>2021-05-10 15:36:42 +0200
commitf5683b4048072b566839ef07a2b6a06da91a07bc (patch)
tree62ebc08999e1356f5f720db77f9e160778c27d07 /src/main/java/makamys/lodmod/mixin/MixinRenderGlobal.java
parentc95e989d793b81530343871a6062059f18bbffdb (diff)
downloadNeodymium-f5683b4048072b566839ef07a2b6a06da91a07bc.tar.gz
Neodymium-f5683b4048072b566839ef07a2b6a06da91a07bc.tar.bz2
Neodymium-f5683b4048072b566839ef07a2b6a06da91a07bc.zip
Fix invisible chunks in OptiFine
Diffstat (limited to 'src/main/java/makamys/lodmod/mixin/MixinRenderGlobal.java')
-rw-r--r--src/main/java/makamys/lodmod/mixin/MixinRenderGlobal.java17
1 files changed, 5 insertions, 12 deletions
diff --git a/src/main/java/makamys/lodmod/mixin/MixinRenderGlobal.java b/src/main/java/makamys/lodmod/mixin/MixinRenderGlobal.java
index 0981974..196e809 100644
--- a/src/main/java/makamys/lodmod/mixin/MixinRenderGlobal.java
+++ b/src/main/java/makamys/lodmod/mixin/MixinRenderGlobal.java
@@ -1,6 +1,7 @@
package makamys.lodmod.mixin;
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.Redirect;
@@ -14,6 +15,9 @@ import net.minecraft.client.renderer.WorldRenderer;
@Mixin(RenderGlobal.class)
abstract class MixinRenderGlobal {
+ @Shadow
+ private WorldRenderer[] sortedWorldRenderers;
+
@Redirect(method = "renderSortedRenderers", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/renderer/RenderGlobal;renderAllRenderLists(ID)V"))
private void redirectRenderAllRenderLists(RenderGlobal thiz, int p1, double p2) {
if(!LODMod.isActive() || (LODMod.isActive() && LODMod.renderer.renderWorld)) {
@@ -21,21 +25,10 @@ abstract class MixinRenderGlobal {
}
}
- @Redirect(method = "renderSortedRenderers", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/renderer/WorldRenderer;getGLCallListForPass(I)I"))
- public int redirectCallList(WorldRenderer thiz, int arg) {
- int numba = thiz.getGLCallListForPass(arg);
- if(LODMod.isActive()) {
- if(numba != -1) {
- LODMod.renderer.onWorldRendererRender(thiz);
- }
- }
- return numba;
- }
-
@Inject(method = "renderSortedRenderers", at = @At(value = "HEAD"))
public void preRenderSortedRenderers(int startRenderer, int numRenderers, int renderPass, double partialTickTime, CallbackInfoReturnable cir) {
if(LODMod.isActive()) {
- LODMod.renderer.preRenderSortedRenderers(renderPass, partialTickTime);
+ LODMod.renderer.preRenderSortedRenderers(renderPass, partialTickTime, sortedWorldRenderers);
}
}
}