aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormakamys <makamys@outlook.com>2022-08-19 05:27:24 +0200
committermakamys <makamys@outlook.com>2022-08-19 05:49:22 +0200
commitc4c49dee5f623e49245eae53cebf7b1245ae3b45 (patch)
tree38793ea27b58a1647c72e94cb4595f14a419db67 /src
parentb79dcda1d2d7d268373bd5c298c17de3cddbab93 (diff)
downloadNeodymium-c4c49dee5f623e49245eae53cebf7b1245ae3b45.tar.gz
Neodymium-c4c49dee5f623e49245eae53cebf7b1245ae3b45.tar.bz2
Neodymium-c4c49dee5f623e49245eae53cebf7b1245ae3b45.zip
Make error logging more verbose
Diffstat (limited to 'src')
-rw-r--r--src/main/java/makamys/neodymium/renderer/ChunkMesh.java29
1 files changed, 21 insertions, 8 deletions
diff --git a/src/main/java/makamys/neodymium/renderer/ChunkMesh.java b/src/main/java/makamys/neodymium/renderer/ChunkMesh.java
index a9055b2..e1023c5 100644
--- a/src/main/java/makamys/neodymium/renderer/ChunkMesh.java
+++ b/src/main/java/makamys/neodymium/renderer/ChunkMesh.java
@@ -27,6 +27,7 @@ import net.minecraft.tileentity.TileEntity;
public class ChunkMesh extends Mesh {
WorldRenderer wr;
+ private int tesselatorDataCount;
private int[] subMeshStart = new int[NORMAL_ORDER.length];
@@ -76,24 +77,36 @@ public class ChunkMesh extends Mesh {
}
private void addTessellatorData(Tessellator t) {
+ tesselatorDataCount++;
+
if(t.vertexCount == 0) {
// Sometimes the tessellator has no vertices and weird flags. Don't warn in this case, just silently return.
return;
}
- boolean errors = false;
+ List<String> errors = new ArrayList<>();
if(t.drawMode != GL11.GL_QUADS && t.drawMode != GL11.GL_TRIANGLES) {
- LOGGER.error("Error in chunk " + tessellatorToString(t) + ": Unsupported draw mode: " + t.drawMode);
- errors = true;
+ errors.add("Unsupported draw mode: " + t.drawMode);
}
if(!t.hasTexture || !t.hasBrightness || !t.hasColor) {
- LOGGER.error("Error in chunk " + tessellatorToString(t) + ": Unsupported tessellator flags");
- errors = true;
+ errors.add(String.format("Unsupported tessellator flags: (hasTexture=%b, hasBrightness=%b, hasColor=%b)", t.hasTexture, t.hasBrightness, t.hasColor));
}
if(t.hasNormals && GL11.glIsEnabled(GL11.GL_LIGHTING)) {
- LOGGER.warn("Warning in chunk " + tessellatorToString(t) + ": Chunk uses GL lighting, this is not implemented.");
+ errors.add("Chunk uses GL lighting, this is not implemented.");
}
- if(errors) {
- LOGGER.error("Skipping chunk due to errors.");
+ 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);
+ }
+ 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;
}