aboutsummaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/makamys/lodmod/LODMod.java4
-rw-r--r--src/main/java/makamys/lodmod/renderer/LODRenderer.java4
-rw-r--r--src/main/java/makamys/lodmod/renderer/SimpleChunkMesh.java4
3 files changed, 7 insertions, 5 deletions
diff --git a/src/main/java/makamys/lodmod/LODMod.java b/src/main/java/makamys/lodmod/LODMod.java
index a5987b5..b41ee2f 100644
--- a/src/main/java/makamys/lodmod/LODMod.java
+++ b/src/main/java/makamys/lodmod/LODMod.java
@@ -45,10 +45,12 @@ public class LODMod
public static LODRenderer renderer;
public static boolean enabled;
+ public static boolean debugEnabled;
public static int chunkLoadsPerTick;
public static List<Class> blockClassBlacklist;
public static double fogStart;
public static double fogEnd;
+ public static float maxSimpleMeshHeight;
private File configFile;
@@ -79,6 +81,8 @@ public class LODMod
.collect(Collectors.toList());
fogStart = config.get("Fog", "fogStart", "0.4").getDouble();
fogEnd = config.get("Fog", "fogEnd", "0.8").getDouble();
+ debugEnabled = config.get("Debug", "enabled", false).getBoolean();
+ maxSimpleMeshHeight = (float)config.get("Debug", "maxSimpleMeshHeight", 1000.0).getDouble();
if(config.hasChanged()) {
config.save();
diff --git a/src/main/java/makamys/lodmod/renderer/LODRenderer.java b/src/main/java/makamys/lodmod/renderer/LODRenderer.java
index 4c911e6..ce74177 100644
--- a/src/main/java/makamys/lodmod/renderer/LODRenderer.java
+++ b/src/main/java/makamys/lodmod/renderer/LODRenderer.java
@@ -52,8 +52,6 @@ import static org.lwjgl.opengl.GL30.*;
public class LODRenderer {
- public static boolean debugEnabled = Boolean.parseBoolean(System.getProperty("lodmod.debug", "false"));
-
public boolean hasInited = false;
private boolean[] wasDown = new boolean[256];
@@ -114,7 +112,7 @@ public class LODRenderer {
}
mainLoop();
- if(debugEnabled) {
+ if(LODMod.debugEnabled) {
handleKeyboard();
}
if(lastGCTime == -1 || (System.currentTimeMillis() - lastGCTime) > gcInterval) {
diff --git a/src/main/java/makamys/lodmod/renderer/SimpleChunkMesh.java b/src/main/java/makamys/lodmod/renderer/SimpleChunkMesh.java
index bef8e46..5d9526c 100644
--- a/src/main/java/makamys/lodmod/renderer/SimpleChunkMesh.java
+++ b/src/main/java/makamys/lodmod/renderer/SimpleChunkMesh.java
@@ -125,9 +125,9 @@ public class SimpleChunkMesh extends Mesh {
if(biome.getFloatTemperature(worldX, y, worldZ) < 0.15f) {
pass1.addCube(worldX, worldY + 0.2f, worldZ, size, size, 1f, Blocks.snow_layer.getIcon(1, 0), 0xFFFFFFFF, brightnessMult);
- pass1.addCube(worldX, worldY - 0.8f, worldZ, size, size, worldY + 1 - 0.8f, icon, color, brightnessMult);
+ pass1.addCube(worldX, worldY - 0.8f, worldZ, size, size, Math.min(LODMod.maxSimpleMeshHeight, worldY + 1 - 0.8f), icon, color, brightnessMult);
} else {
- pass1.addCube(worldX, worldY, worldZ, size, size, worldY + 1, icon, color, brightnessMult);
+ pass1.addCube(worldX, worldY, worldZ, size, size, Math.min(LODMod.maxSimpleMeshHeight, worldY + 1), icon, color, brightnessMult);
}