2019-05-27 17:13:41 +08:00
|
|
|
From fa25cf3ca7063d1bb2dd2aa78ca5f2b3067266d6 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-05-27 17:13:41 +08:00
|
|
|
index 92ab55182..eed454bf4 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-27 14:26:04 +08:00
|
|
|
@@ -296,4 +296,9 @@ public class PaperWorldConfig {
|
|
|
|
preventTntFromMovingInWater = getBoolean("prevent-tnt-from-moving-in-water", false);
|
|
|
|
log("Prevent TNT from moving in water: " + preventTntFromMovingInWater);
|
2016-10-06 05:28:17 +08:00
|
|
|
}
|
|
|
|
+
|
|
|
|
+ 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-05-27 17:13:41 +08:00
|
|
|
index 2da7c4531..7bd5a0a8c 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-05-27 14:14:14 +08:00
|
|
|
@@ -533,6 +533,12 @@ public class Chunk implements IChunkAccess {
|
2019-04-27 14:26:04 +08:00
|
|
|
"Chunk coordinates: " + (this.loc.x * 16) + "," + (this.loc.z * 16));
|
2016-10-06 05:28:17 +08:00
|
|
|
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-05 12:52:02 +08:00
|
|
|
2.21.0
|
2016-10-06 05:28:17 +08:00
|
|
|
|