From 363a8d595c146ad1285a32824e16fbd06bed4c6d Mon Sep 17 00:00:00 2001 From: Jonas Herzig Date: Sat, 23 May 2020 22:05:42 +0200 Subject: [PATCH] Apply OF chunk building bug fix only during rendering (fixes #164) --- .../compat/shaders/mixin/MixinShaderRenderChunk.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main/java/com/replaymod/compat/shaders/mixin/MixinShaderRenderChunk.java b/src/main/java/com/replaymod/compat/shaders/mixin/MixinShaderRenderChunk.java index 47295f28..b803ed2d 100644 --- a/src/main/java/com/replaymod/compat/shaders/mixin/MixinShaderRenderChunk.java +++ b/src/main/java/com/replaymod/compat/shaders/mixin/MixinShaderRenderChunk.java @@ -45,6 +45,11 @@ public abstract class MixinShaderRenderChunk { ci.setReturnValue(false); } else if (!this.shouldBuild()) { // this is the check which OF removed + // So, I think I figured out the reason why optifine applies this change: It's so chunks which are outside + // the server view distance are still rendered if they've previously compiled. The bug still stands but + // fixing it breaks OF's broken feature, so to reduce the impact of our fix, we only apply it during + // rendering where it affects us the most. + if (((EntityRendererHandler.IEntityRenderer) mc.gameRenderer).replayModRender_getHandler() == null) return; ci.setReturnValue(false); } }