2019-04-23 05:36:14 +08:00
|
|
|
From 6a37f4af427998aa81105d6a80cca73b74427ee7 Mon Sep 17 00:00:00 2001
|
2016-10-06 05:28:17 +08:00
|
|
|
From: Zach Brown <zach.brown@destroystokyo.com>
|
|
|
|
Date: Wed, 5 Oct 2016 16:27:36 -0500
|
|
|
|
Subject: [PATCH] Option to remove corrupt tile entities
|
|
|
|
|
|
|
|
|
|
|
|
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
2019-04-06 11:08:45 +08:00
|
|
|
index 6e28410c37..7e847af00b 100644
|
2016-10-06 05:28:17 +08:00
|
|
|
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
|
|
|
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
2019-04-05 13:27:37 +08:00
|
|
|
@@ -340,4 +340,9 @@ public class PaperWorldConfig {
|
2016-10-06 05:28:17 +08:00
|
|
|
private void maxAutoSaveChunksPerTick() {
|
|
|
|
maxAutoSaveChunksPerTick = getInt("max-auto-save-chunks-per-tick", 24);
|
|
|
|
}
|
|
|
|
+
|
|
|
|
+ public boolean removeCorruptTEs = false;
|
|
|
|
+ private void removeCorruptTEs() {
|
|
|
|
+ removeCorruptTEs = getBoolean("remove-corrupt-tile-entities", false);
|
|
|
|
+ }
|
|
|
|
}
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java
|
2019-04-06 11:08:45 +08:00
|
|
|
index 0bf614ce57..a6cacd7da9 100644
|
2016-10-06 05:28:17 +08:00
|
|
|
--- a/src/main/java/net/minecraft/server/Chunk.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/Chunk.java
|
2019-04-06 11:08:45 +08:00
|
|
|
@@ -844,6 +844,12 @@ public class Chunk implements IChunkAccess {
|
2016-10-06 05:28:17 +08:00
|
|
|
"Chunk coordinates: " + (this.locX * 16) + "," + (this.locZ * 16));
|
|
|
|
e.printStackTrace();
|
|
|
|
ServerInternalException.reportInternalException(e);
|
|
|
|
+
|
|
|
|
+ if (this.world.paperConfig.removeCorruptTEs) {
|
|
|
|
+ this.removeTileEntity(tileentity.getPosition());
|
2018-06-15 12:11:39 +08:00
|
|
|
+ this.markDirty();
|
2016-10-06 05:28:17 +08:00
|
|
|
+ org.bukkit.Bukkit.getLogger().info("Removing corrupt tile entity");
|
|
|
|
+ }
|
|
|
|
// Paper end
|
|
|
|
// CraftBukkit end
|
|
|
|
}
|
2019-04-06 11:08:45 +08:00
|
|
|
@@ -853,6 +859,7 @@ public class Chunk implements IChunkAccess {
|
2018-08-27 02:11:49 +08:00
|
|
|
this.h.put(new BlockPosition(nbttagcompound.getInt("x"), nbttagcompound.getInt("y"), nbttagcompound.getInt("z")), nbttagcompound);
|
2016-10-06 05:28:17 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
+ public void removeTileEntity(BlockPosition blockposition) { this.d(blockposition); } // Paper - OBFHELPER
|
|
|
|
public void d(BlockPosition blockposition) {
|
2018-08-27 02:11:49 +08:00
|
|
|
if (this.i) {
|
2016-10-06 05:28:17 +08:00
|
|
|
TileEntity tileentity = (TileEntity) this.tileEntities.remove(blockposition);
|
|
|
|
--
|
2019-04-05 12:52:02 +08:00
|
|
|
2.21.0
|
2016-10-06 05:28:17 +08:00
|
|
|
|