aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/makamys/lodmod/renderer/LODRenderer.java
diff options
context:
space:
mode:
authormakamys <makamys@outlook.com>2021-06-16 17:35:25 +0200
committermakamys <makamys@outlook.com>2021-06-16 17:40:50 +0200
commit2d8a1c193494b1563282426be707fb7cac75f43f (patch)
tree87db51b57177291cbff2c2b250d9583305993650 /src/main/java/makamys/lodmod/renderer/LODRenderer.java
parent9360f9d3a8d7ddd6079341f48a3464ccff06deaa (diff)
downloadNeodymium-2d8a1c193494b1563282426be707fb7cac75f43f.tar.gz
Neodymium-2d8a1c193494b1563282426be707fb7cac75f43f.tar.bz2
Neodymium-2d8a1c193494b1563282426be707fb7cac75f43f.zip
Don't enable renderer in hell worlds (e.g. nether)
Diffstat (limited to 'src/main/java/makamys/lodmod/renderer/LODRenderer.java')
-rw-r--r--src/main/java/makamys/lodmod/renderer/LODRenderer.java10
1 files changed, 8 insertions, 2 deletions
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<LODChunk> {
Entity player;