aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/makamys/neodymium
diff options
context:
space:
mode:
authormakamys <makamys@outlook.com>2022-08-19 05:54:19 +0200
committermakamys <makamys@outlook.com>2022-08-19 05:54:19 +0200
commita36c12b2b99307a561001c172cffbee7f719d1f4 (patch)
treed08c8624021ea3f26b3d734f533da3a218ec6e61 /src/main/java/makamys/neodymium
parentc4c49dee5f623e49245eae53cebf7b1245ae3b45 (diff)
downloadNeodymium-a36c12b2b99307a561001c172cffbee7f719d1f4.tar.gz
Neodymium-a36c12b2b99307a561001c172cffbee7f719d1f4.tar.bz2
Neodymium-a36c12b2b99307a561001c172cffbee7f719d1f4.zip
Add option to not print rendering errors
Diffstat (limited to 'src/main/java/makamys/neodymium')
-rw-r--r--src/main/java/makamys/neodymium/config/Config.java2
-rw-r--r--src/main/java/makamys/neodymium/renderer/ChunkMesh.java24
2 files changed, 15 insertions, 11 deletions
diff --git a/src/main/java/makamys/neodymium/config/Config.java b/src/main/java/makamys/neodymium/config/Config.java
index a8ea60e..8dc7ffa 100644
--- a/src/main/java/makamys/neodymium/config/Config.java
+++ b/src/main/java/makamys/neodymium/config/Config.java
@@ -71,6 +71,8 @@ public class Config {
public static boolean replaceOpenGLSplash;
@ConfigBoolean(cat="misc", def=false, com="Don't warn about incompatibilities in chat, and activate renderer even in spite of critical ones.")
public static boolean ignoreIncompatibilities;
+ @ConfigBoolean(cat="misc", def=false, com="Don't print non-critical rendering errors.")
+ public static boolean silenceErrors;
@ConfigInt(cat="debug", def=-1, min=-1, max=Integer.MAX_VALUE)
public static int maxMeshesPerFrame;
diff --git a/src/main/java/makamys/neodymium/renderer/ChunkMesh.java b/src/main/java/makamys/neodymium/renderer/ChunkMesh.java
index e1023c5..8809c17 100644
--- a/src/main/java/makamys/neodymium/renderer/ChunkMesh.java
+++ b/src/main/java/makamys/neodymium/renderer/ChunkMesh.java
@@ -94,18 +94,20 @@ public class ChunkMesh extends Mesh {
errors.add("Chunk uses GL lighting, this is not implemented.");
}
if(!errors.isEmpty()) {
- try {
- // Generate a stack trace
- throw new IllegalArgumentException();
- } catch(IllegalArgumentException e) {
- LOGGER.error("Errors in chunk ({}, {}, {})", x, y, z);
- for(String error : errors) {
- LOGGER.error("Error: " + error);
+ if(!Config.silenceErrors) {
+ try {
+ // Generate a stack trace
+ throw new IllegalArgumentException();
+ } catch(IllegalArgumentException e) {
+ LOGGER.error("Errors in chunk ({}, {}, {})", x, y, z);
+ for(String error : errors) {
+ LOGGER.error("Error: " + error);
+ }
+ LOGGER.error("(World renderer pos: ({}, {}, {}), Tessellator pos: ({}, {}, {}), Tessellation count: {}", wr.posX, wr.posY, wr.posZ, t.xOffset, t.yOffset, t.zOffset, tesselatorDataCount);
+ LOGGER.error("Stack trace:");
+ e.printStackTrace();
+ LOGGER.error("Skipping chunk due to errors.");
}
- LOGGER.error("(World renderer pos: ({}, {}, {}), Tessellator pos: ({}, {}, {}), Tessellation count: {}", wr.posX, wr.posY, wr.posZ, t.xOffset, t.yOffset, t.zOffset, tesselatorDataCount);
- LOGGER.error("Stack trace:");
- e.printStackTrace();
- LOGGER.error("Skipping chunk due to errors.");
}
return;
}