Prevent block entity and entity crashes

This commit is contained in:
Aikar
2016-03-01 23:52:34 -06:00
parent 6212f523fa
commit 0255317409
3 changed files with 55 additions and 15 deletions

View File

@@ -322,10 +322,20 @@
this.ticker = blockentityticker;
}
@@ -872,6 +993,7 @@
@@ -867,11 +988,12 @@
this.blockEntity.fillCrashReportCategory(crashreportsystemdetails);
throw new ReportedException(crashreport);
gameprofilerfiller.pop();
} catch (Throwable throwable) {
- CrashReport crashreport = CrashReport.forThrowable(throwable, "Ticking block entity");
- CrashReportCategory crashreportsystemdetails = crashreport.addCategory("Block entity being ticked");
-
- this.blockEntity.fillCrashReportCategory(crashreportsystemdetails);
- throw new ReportedException(crashreport);
+ // Paper start - Prevent block entity and entity crashes
+ 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 - Prevent block entity and entity crashes
+ // Spigot start
}
}