aboutsummaryrefslogtreecommitdiffhomepage
path: root/Spigot-Server-Patches-Unmapped/0115-Option-to-remove-corrupt-tile-entities.patch
diff options
context:
space:
mode:
Diffstat (limited to 'Spigot-Server-Patches-Unmapped/0115-Option-to-remove-corrupt-tile-entities.patch')
-rw-r--r--Spigot-Server-Patches-Unmapped/0115-Option-to-remove-corrupt-tile-entities.patch37
1 files changed, 37 insertions, 0 deletions
diff --git a/Spigot-Server-Patches-Unmapped/0115-Option-to-remove-corrupt-tile-entities.patch b/Spigot-Server-Patches-Unmapped/0115-Option-to-remove-corrupt-tile-entities.patch
new file mode 100644
index 0000000000..c9e047b2c4
--- /dev/null
+++ b/Spigot-Server-Patches-Unmapped/0115-Option-to-remove-corrupt-tile-entities.patch
@@ -0,0 +1,37 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Zach Brown <[email protected]>
+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
+index 6eca3f300020006f02dd36253b522db442e3cc33..622affa0dc3cc1eadaed400511f2ca2cde3fca2a 100644
+--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
++++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+@@ -300,4 +300,9 @@ public class PaperWorldConfig {
+ preventTntFromMovingInWater = getBoolean("prevent-tnt-from-moving-in-water", false);
+ log("Prevent TNT from moving in water: " + preventTntFromMovingInWater);
+ }
++
++ public boolean removeCorruptTEs = false;
++ private void removeCorruptTEs() {
++ removeCorruptTEs = getBoolean("remove-corrupt-tile-entities", false);
++ }
+ }
+diff --git a/src/main/java/net/minecraft/world/level/chunk/Chunk.java b/src/main/java/net/minecraft/world/level/chunk/Chunk.java
+index b6898cd6e6117fef65198db32b98a64c806811d4..7918dd4ad3e8cbb905b3929062a70fb7961b7d68 100644
+--- a/src/main/java/net/minecraft/world/level/chunk/Chunk.java
++++ b/src/main/java/net/minecraft/world/level/chunk/Chunk.java
+@@ -679,6 +679,12 @@ public class Chunk implements IChunkAccess {
+ "Chunk coordinates: " + (this.loc.x * 16) + "," + (this.loc.z * 16));
+ e.printStackTrace();
+ ServerInternalException.reportInternalException(e);
++
++ if (this.world.paperConfig.removeCorruptTEs) {
++ this.removeTileEntity(tileentity.getPosition());
++ this.markDirty();
++ org.bukkit.Bukkit.getLogger().info("Removing corrupt tile entity");
++ }
+ // Paper end
+ // CraftBukkit end
+ }