diff options
author | makamys <makamys@outlook.com> | 2021-05-10 07:48:36 +0200 |
---|---|---|
committer | makamys <makamys@outlook.com> | 2021-05-10 08:53:49 +0200 |
commit | b6c09b36b4db668abf185b77433e15a5a2b28820 (patch) | |
tree | 2edf4aa51f6f3a84a2445d7e7fafe564f85ce46c /src | |
parent | 835c07aba1268d372ee7ecc577ac3ccbc0ef2133 (diff) | |
download | Neodymium-b6c09b36b4db668abf185b77433e15a5a2b28820.tar.gz Neodymium-b6c09b36b4db668abf185b77433e15a5a2b28820.tar.bz2 Neodymium-b6c09b36b4db668abf185b77433e15a5a2b28820.zip |
Make things work nicer if LODRenderer is inactive
Diffstat (limited to 'src')
4 files changed, 5 insertions, 3 deletions
diff --git a/src/main/java/makamys/lodmod/LODMod.java b/src/main/java/makamys/lodmod/LODMod.java index 57f3d41..87d6b1e 100644 --- a/src/main/java/makamys/lodmod/LODMod.java +++ b/src/main/java/makamys/lodmod/LODMod.java @@ -61,7 +61,7 @@ public class LODMod } public static boolean isActive() { - return renderer != null; + return renderer != null && renderer.hasInited; } @SubscribeEvent diff --git a/src/main/java/makamys/lodmod/mixin/MixinEntityRenderer.java b/src/main/java/makamys/lodmod/mixin/MixinEntityRenderer.java index 9a79b46..7f19e24 100644 --- a/src/main/java/makamys/lodmod/mixin/MixinEntityRenderer.java +++ b/src/main/java/makamys/lodmod/mixin/MixinEntityRenderer.java @@ -46,6 +46,8 @@ abstract class MixinEntityRenderer { } else { GL11.glFogf(pname, param); } + } else { + GL11.glFogf(pname, param); } } } diff --git a/src/main/java/makamys/lodmod/mixin/MixinRenderGlobal.java b/src/main/java/makamys/lodmod/mixin/MixinRenderGlobal.java index e6f4de7..51a8b11 100644 --- a/src/main/java/makamys/lodmod/mixin/MixinRenderGlobal.java +++ b/src/main/java/makamys/lodmod/mixin/MixinRenderGlobal.java @@ -13,7 +13,7 @@ abstract class MixinRenderGlobal { @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.renderer.renderWorld) { + if(!LODMod.isActive() || (LODMod.isActive() && LODMod.renderer.renderWorld)) { thiz.renderAllRenderLists(p1, p2); } } diff --git a/src/main/java/makamys/lodmod/renderer/LODRenderer.java b/src/main/java/makamys/lodmod/renderer/LODRenderer.java index 7287f01..3385c39 100644 --- a/src/main/java/makamys/lodmod/renderer/LODRenderer.java +++ b/src/main/java/makamys/lodmod/renderer/LODRenderer.java @@ -48,7 +48,7 @@ import static org.lwjgl.opengl.GL30.*; public class LODRenderer { - private boolean hasInited = false; + public boolean hasInited = false; private boolean[] wasDown = new boolean[256]; private int renderQuads = 0; |