2021-06-11 14:02:28 +02:00
|
|
|
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
|
2021-06-12 08:02:49 +02:00
|
|
|
index 9b2e9a02ff31c3cb37b67135d0a03441f247d8e2..96247356d7888d5681bff60567add1188aedb18b 100644
|
2021-06-11 14:02:28 +02:00
|
|
|
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
|
|
|
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
2021-06-12 08:02:49 +02:00
|
|
|
@@ -301,4 +301,9 @@ public class PaperWorldConfig {
|
2021-06-11 14:02:28 +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/world/level/chunk/LevelChunk.java b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
2021-07-18 09:41:53 +02:00
|
|
|
index 702dbe24bfd19b0999648d4364f68a5675bee6e0..8141935e2ee58bbb58c6b5cfdef5a9a88d7658ec 100644
|
2021-06-11 14:02:28 +02:00
|
|
|
--- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
|
|
|
+++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
2021-06-12 08:02:49 +02:00
|
|
|
@@ -640,6 +640,12 @@ public class LevelChunk implements ChunkAccess {
|
|
|
|
"Chunk coordinates: " + (this.chunkPos.x * 16) + "," + (this.chunkPos.z * 16));
|
2021-06-11 14:02:28 +02:00
|
|
|
e.printStackTrace();
|
|
|
|
ServerInternalException.reportInternalException(e);
|
|
|
|
+
|
2021-06-12 08:02:49 +02:00
|
|
|
+ if (this.level.paperConfig.removeCorruptTEs) {
|
2021-06-11 14:02:28 +02:00
|
|
|
+ this.removeBlockEntity(blockEntity.getBlockPos());
|
|
|
|
+ this.markUnsaved();
|
|
|
|
+ org.bukkit.Bukkit.getLogger().info("Removing corrupt tile entity");
|
|
|
|
+ }
|
|
|
|
// Paper end
|
|
|
|
// CraftBukkit end
|
|
|
|
}
|