Skip to content

Commit

Permalink
attempt to fix occlusionrenderer crash
Browse files Browse the repository at this point in the history
  • Loading branch information
FalsePattern committed Dec 8, 2024
1 parent 841098b commit 9672fc3
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import com.falsepattern.falsetweaks.modules.occlusion.OcclusionRenderer;
import com.falsepattern.falsetweaks.modules.occlusion.OcclusionWorker;
import com.falsepattern.falsetweaks.modules.occlusion.interfaces.IRenderGlobalMixin;
import lombok.val;
import org.objectweb.asm.Opcodes;
import org.spongepowered.asm.mixin.Dynamic;
import org.spongepowered.asm.mixin.Mixin;
Expand Down Expand Up @@ -89,8 +90,13 @@ public String getDebugInfoRenders() {
at = @At("RETURN"),
require = 1)
private void initBetterLists(Minecraft p_i1249_1_, CallbackInfo ci) {
OcclusionHelpers.renderer = new OcclusionRenderer((RenderGlobal) (Object) this);
OcclusionHelpers.renderer.initBetterLists();
synchronized (OcclusionHelpers.class) {
if (OcclusionHelpers.renderer == null) {
val r = new OcclusionRenderer((RenderGlobal) (Object) this);
OcclusionHelpers.renderer = r;
r.initBetterLists();
}
}
}

@Redirect(method = "loadRenderers",
Expand Down

0 comments on commit 9672fc3

Please sign in to comment.