2018-07-04 15:55:24 +08:00
|
|
|
From 5b908630761c4e62419ce38535eaa3b715c34675 Mon Sep 17 00:00:00 2001
|
2016-10-06 05:28:17 +08:00
|
|
|
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
|
2018-06-15 12:11:39 +08:00
|
|
|
index ce848d63e..93b0af036 100644
|
2016-10-06 05:28:17 +08:00
|
|
|
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
|
|
|
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
2018-05-31 04:31:55 +08:00
|
|
|
@@ -379,4 +379,9 @@ public class PaperWorldConfig {
|
2016-10-06 05:28:17 +08:00
|
|
|
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
|
2018-07-04 15:55:24 +08:00
|
|
|
index a59f5b190..27a36b2b0 100644
|
2016-10-06 05:28:17 +08:00
|
|
|
--- a/src/main/java/net/minecraft/server/Chunk.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/Chunk.java
|
2018-07-04 15:55:24 +08:00
|
|
|
@@ -823,11 +823,18 @@ public class Chunk {
|
2016-10-06 05:28:17 +08:00
|
|
|
"Chunk coordinates: " + (this.locX * 16) + "," + (this.locZ * 16));
|
|
|
|
e.printStackTrace();
|
|
|
|
ServerInternalException.reportInternalException(e);
|
|
|
|
+
|
|
|
|
+ if (this.world.paperConfig.removeCorruptTEs) {
|
|
|
|
+ this.removeTileEntity(tileentity.getPosition());
|
2018-06-15 12:11:39 +08:00
|
|
|
+ this.markDirty();
|
2016-10-06 05:28:17 +08:00
|
|
|
+ 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);
|
|
|
|
--
|
2018-07-04 15:55:24 +08:00
|
|
|
2.18.0
|
2016-10-06 05:28:17 +08:00
|
|
|
|