2019-01-01 03:15:55 +00:00
|
|
|
From 984982d70b5d3b3fdb0b5c930d8d4a24b09628e9 Mon Sep 17 00:00:00 2001
|
2016-10-05 21:28:17 +00: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-12-13 00:40:29 +00:00
|
|
|
index 47bfb5b62..e8417cb2e 100644
|
2016-10-05 21:28:17 +00:00
|
|
|
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
|
|
|
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
2018-12-13 00:40:29 +00:00
|
|
|
@@ -331,4 +331,9 @@ public class PaperWorldConfig {
|
2016-10-05 21:28:17 +00: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
|
2019-01-01 03:15:55 +00:00
|
|
|
index 0d70ce797..6150b56e0 100644
|
2016-10-05 21:28:17 +00:00
|
|
|
--- a/src/main/java/net/minecraft/server/Chunk.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/Chunk.java
|
2019-01-01 03:15:55 +00:00
|
|
|
@@ -843,6 +843,12 @@ public class Chunk implements IChunkAccess {
|
2016-10-05 21:28:17 +00: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 04:11:39 +00:00
|
|
|
+ this.markDirty();
|
2016-10-05 21:28:17 +00:00
|
|
|
+ org.bukkit.Bukkit.getLogger().info("Removing corrupt tile entity");
|
|
|
|
+ }
|
|
|
|
// Paper end
|
|
|
|
// CraftBukkit end
|
|
|
|
}
|
2019-01-01 03:15:55 +00:00
|
|
|
@@ -852,6 +858,7 @@ public class Chunk implements IChunkAccess {
|
2018-08-26 18:11:49 +00:00
|
|
|
this.h.put(new BlockPosition(nbttagcompound.getInt("x"), nbttagcompound.getInt("y"), nbttagcompound.getInt("z")), nbttagcompound);
|
2016-10-05 21:28:17 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
+ public void removeTileEntity(BlockPosition blockposition) { this.d(blockposition); } // Paper - OBFHELPER
|
|
|
|
public void d(BlockPosition blockposition) {
|
2018-08-26 18:11:49 +00:00
|
|
|
if (this.i) {
|
2016-10-05 21:28:17 +00:00
|
|
|
TileEntity tileentity = (TileEntity) this.tileEntities.remove(blockposition);
|
|
|
|
--
|
2019-01-01 03:15:55 +00:00
|
|
|
2.20.1
|
2016-10-05 21:28:17 +00:00
|
|
|
|