Deobfuscate stacktraces in log messages using a RewriteAppender and a custom RewritePolicy (#5926)
Also replace a couple calls to `System.err` with logger usages, as traces printed with the former do not get deobfuscated.
This commit is contained in:
parent
1830de58bf
commit
10e9c5a01c
8 changed files with 415 additions and 39 deletions
|
@ -5,7 +5,7 @@ Subject: [PATCH] Prevent tile entity and entity crashes
|
|||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
||||
index d29334b5dee6fe3f292f774442304b7dc6b0e2f0..d6ed061e36668ea1cbaee44c06575534336008fc 100644
|
||||
index d29334b5dee6fe3f292f774442304b7dc6b0e2f0..939f88ab37eca30e8ad08cbe2045b66ee64aa952 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/Level.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
||||
@@ -729,11 +729,11 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||
|
@ -18,8 +18,8 @@ index d29334b5dee6fe3f292f774442304b7dc6b0e2f0..d6ed061e36668ea1cbaee44c06575534
|
|||
- entity.fillCrashReportCategory(crashreportsystemdetails);
|
||||
- throw new ReportedException(crashreport);
|
||||
+ // Paper start - Prevent tile entity and entity crashes
|
||||
+ System.err.println("Entity threw exception at " + entity.level.getWorld().getName() + ":" + entity.getX() + "," + entity.getY() + "," + entity.getZ());
|
||||
+ throwable.printStackTrace();
|
||||
+ final String msg = String.format("Entity threw exception at %s:%s,%s,%s", entity.level.getWorld().getName(), entity.getX(), entity.getY(), entity.getZ());
|
||||
+ MinecraftServer.LOGGER.error(msg, throwable);
|
||||
+ entity.discard();
|
||||
+ // Paper end
|
||||
}
|
||||
|
@ -44,7 +44,7 @@ index 7b333e2d6884b272abefbc820bcce8026a4cdf7e..66ab4deedd177f507d170a61ceca4c3e
|
|||
}
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
||||
index 743aafec1f1c819846813688355dd90534dddb3e..21f613b8d7785b996866b5059f3cb1bc87533d2e 100644
|
||||
index 743aafec1f1c819846813688355dd90534dddb3e..5bd2172a88c95722b86959e42442e8a3ab76879c 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
||||
@@ -1241,11 +1241,11 @@ public class LevelChunk implements ChunkAccess {
|
||||
|
@ -57,8 +57,8 @@ index 743aafec1f1c819846813688355dd90534dddb3e..21f613b8d7785b996866b5059f3cb1bc
|
|||
- this.blockEntity.fillCrashReportCategory(crashreportsystemdetails);
|
||||
- throw new ReportedException(crashreport);
|
||||
+ // Paper start - Prevent tile entity and entity crashes
|
||||
+ System.err.println("TileEntity threw exception at " + LevelChunk.this.getLevel().getWorld().getName() + ":" + this.getPos().getX() + "," + this.getPos().getY() + "," + this.getPos().getZ());
|
||||
+ throwable.printStackTrace();
|
||||
+ final String msg = String.format("BlockEntity threw exception at %s:%s,%s,%s", LevelChunk.this.getLevel().getWorld().getName(), this.getPos().getX(), this.getPos().getY(), this.getPos().getZ());
|
||||
+ net.minecraft.server.MinecraftServer.LOGGER.error(msg, throwable);
|
||||
+ LevelChunk.this.removeBlockEntity(this.getPos());
|
||||
+ // Paper end
|
||||
// Spigot start
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue