From 2d8a1c193494b1563282426be707fb7cac75f43f Mon Sep 17 00:00:00 2001 From: makamys Date: Wed, 16 Jun 2021 17:35:25 +0200 Subject: Don't enable renderer in hell worlds (e.g. nether) --- src/main/java/makamys/lodmod/renderer/LODRenderer.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/main/java/makamys/lodmod/renderer/LODRenderer.java') diff --git a/src/main/java/makamys/lodmod/renderer/LODRenderer.java b/src/main/java/makamys/lodmod/renderer/LODRenderer.java index 2d08bfb..c3ae345 100644 --- a/src/main/java/makamys/lodmod/renderer/LODRenderer.java +++ b/src/main/java/makamys/lodmod/renderer/LODRenderer.java @@ -96,8 +96,10 @@ public class LODRenderer { public boolean disableChunkMeshes = true; public LODRenderer(World world){ - hasInited = init(); - this.world = world; + this.world = world; + if(shouldRenderInWorld(world)) { + hasInited = init(); + } } public void preRenderSortedRenderers(int renderPass, double alpha, WorldRenderer[] sortedWorldRenderers) { @@ -663,6 +665,10 @@ public class LODRenderer { return Minecraft.getMinecraft().mcDataDir.toPath().resolve("lodmod").resolve(Minecraft.getMinecraft().getIntegratedServer().getFolderName()); } + private boolean shouldRenderInWorld(World world) { + return world != null && !world.provider.isHellWorld; + } + public static class LODChunkComparator implements Comparator { Entity player; -- cgit