2018-07-24 02:24:44 +02:00
|
|
|
From ebe77e76a5d76ad93b286e6a654d8e4b78c85c93 Mon Sep 17 00:00:00 2001
|
2016-10-05 23:28:17 +02: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-07-24 02:24:44 +02:00
|
|
|
index 499230af6..189ec79f0 100644
|
2016-10-05 23:28:17 +02:00
|
|
|
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
|
|
|
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
2018-07-24 02:24:44 +02:00
|
|
|
@@ -315,4 +315,9 @@ public class PaperWorldConfig {
|
2016-10-05 23:28:17 +02: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-24 02:24:44 +02:00
|
|
|
index 06d6814b8..7a797bef0 100644
|
2016-10-05 23:28:17 +02:00
|
|
|
--- a/src/main/java/net/minecraft/server/Chunk.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/Chunk.java
|
2018-07-22 19:10:15 +02:00
|
|
|
@@ -829,6 +829,12 @@ public class Chunk implements IChunkAccess {
|
2016-10-05 23:28:17 +02: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 06:11:39 +02:00
|
|
|
+ this.markDirty();
|
2016-10-05 23:28:17 +02:00
|
|
|
+ org.bukkit.Bukkit.getLogger().info("Removing corrupt tile entity");
|
|
|
|
+ }
|
|
|
|
// Paper end
|
|
|
|
// CraftBukkit end
|
|
|
|
}
|
2018-07-22 19:10:15 +02:00
|
|
|
@@ -838,6 +844,7 @@ public class Chunk implements IChunkAccess {
|
2018-07-16 22:08:09 +02:00
|
|
|
this.i.put(new BlockPosition(nbttagcompound.getInt("x"), nbttagcompound.getInt("y"), nbttagcompound.getInt("z")), nbttagcompound);
|
2016-10-05 23:28:17 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
+ 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 09:55:24 +02:00
|
|
|
2.18.0
|
2016-10-05 23:28:17 +02:00
|
|
|
|