3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-12-16 03:20:07 +01:00
Paper/patches/removed/1.18.2/0109-Option-to-remove-corrupt-tile-entities.patch

48 Zeilen
2.4 KiB
Diff

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
2022-03-11 21:13:46 +01:00
Corrupt tile entities are never added to the world in the first place anymore.
2021-06-11 14:02:28 +02:00
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
2021-11-24 18:58:26 +01:00
index d7734fbc6b684b14bc32c94e65947fb41aae126a..80345730b8ccc11d3d0833485d25b03f614aeee2 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-11-24 18:58:26 +01:00
@@ -347,4 +347,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
index 3ecb007cf0ae781a2a68ca0a190616daf3e4aa88..e9436ab14bac2b5267239bcb27ad450d93c680e4 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
@@ -259,7 +259,7 @@ public class LevelChunk extends ChunkAccess {
2021-11-23 14:22:49 +01:00
}
this.setLightCorrect(protoChunk.isLightCorrect());
- this.unsaved = true;
+ this.setUnsaved(true);
this.needsDecoration = true; // CraftBukkit
// CraftBukkit start
this.persistentDataContainer = protoChunk.persistentDataContainer; // SPIGOT-6814: copy PDC to account for 1.17 to 1.18 chunk upgrading.
@@ -582,6 +582,12 @@ public class LevelChunk extends ChunkAccess {
2021-06-12 08:02:49 +02:00
"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());
2021-11-23 14:22:49 +01:00
+ this.setUnsaved(true);
2021-06-11 14:02:28 +02:00
+ org.bukkit.Bukkit.getLogger().info("Removing corrupt tile entity");
+ }
// Paper end
// CraftBukkit end
}