diff options
author | Zach Brown <[email protected]> | 2016-10-05 16:28:17 -0500 |
---|---|---|
committer | Zach Brown <[email protected]> | 2016-10-05 16:28:17 -0500 |
commit | 5ecb6f1358ae89dbf5cbff7ef246bf755bceb96c (patch) | |
tree | 8db69a247b6cc54059bcfb6718cb2874c7b34d25 | |
parent | 82420acbea097da3796d9cc316d761ef1d2f62a4 (diff) | |
download | Paper-5ecb6f1358ae89dbf5cbff7ef246bf755bceb96c.tar.gz Paper-5ecb6f1358ae89dbf5cbff7ef246bf755bceb96c.zip |
Add option to remove corrupt tile entities
Closes GH-437
-rw-r--r-- | Spigot-Server-Patches/0179-Option-to-remove-corrupt-tile-entities.patch | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/Spigot-Server-Patches/0179-Option-to-remove-corrupt-tile-entities.patch b/Spigot-Server-Patches/0179-Option-to-remove-corrupt-tile-entities.patch new file mode 100644 index 0000000000..b22f7371ef --- /dev/null +++ b/Spigot-Server-Patches/0179-Option-to-remove-corrupt-tile-entities.patch @@ -0,0 +1,45 @@ +From d7bacc4801ac21c5a432cc5a47ab4ffa053f48bb 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 eacb1f6..51b34d9 100644 +--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java ++++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +@@ -393,4 +393,9 @@ public class PaperWorldConfig { + 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 +index 547628a..9f39530 100644 +--- a/src/main/java/net/minecraft/server/Chunk.java ++++ b/src/main/java/net/minecraft/server/Chunk.java +@@ -783,11 +783,17 @@ public class Chunk { + "Chunk coordinates: " + (this.locX * 16) + "," + (this.locZ * 16)); + e.printStackTrace(); + ServerInternalException.reportInternalException(e); ++ ++ if (this.world.paperConfig.removeCorruptTEs) { ++ this.removeTileEntity(tileentity.getPosition()); ++ org.bukkit.Bukkit.getLogger().info("Removing corrupt tile entity"); ++ } + // Paper end + // CraftBukkit end + } + } + ++ public void removeTileEntity(BlockPosition blockposition) { this.d(blockposition); } // Paper - OBFHELPER + public void d(BlockPosition blockposition) { + if (this.j) { + TileEntity tileentity = (TileEntity) this.tileEntities.remove(blockposition); +-- +2.10.0 + |