Paper/Spigot-Server-Patches/0114-Option-to-remove-corrupt-tile-entities.patch

38 Zeilen
1.8 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
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
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 {
2019-04-27 08:26:04 +02:00
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/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java
index f9ad646f3061914e55e424602abe27da7f1c0865..8dd560c8207f14123ab9c9820d8ce7333775db35 100644
--- a/src/main/java/net/minecraft/server/Chunk.java
+++ b/src/main/java/net/minecraft/server/Chunk.java
@@ -641,6 +641,12 @@ public class Chunk implements IChunkAccess {
2019-04-27 08:26:04 +02:00
"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
}