Paper/Spigot-Server-Patches/0119-Option-to-remove-corrupt-tile-entities.patch
Spottedleaf 19de9af63c 1.15.2 update (#2887)
Functional GUI fix added by billygalbreath
2020-01-21 20:02:07 -06:00

41 lines
1.7 KiB
Diff

From e6ba1a2e2785f34574ea5ee7c0f93dbde806c2aa 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 8cf3076f4..721eceeff 100644
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
@@ -298,4 +298,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/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java
index 034e8684d..1efddb533 100644
--- a/src/main/java/net/minecraft/server/Chunk.java
+++ b/src/main/java/net/minecraft/server/Chunk.java
@@ -526,6 +526,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
}
--
2.25.0.windows.1