2016-12-11 00:50:31 +01:00
|
|
|
From d52728bb4d71f2069314213896b745c729848c2b 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
|
2016-11-17 03:23:38 +01:00
|
|
|
index da530f9..376b9ed 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
|
2016-11-17 03:23:38 +01:00
|
|
|
@@ -381,4 +381,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
|
2016-11-17 03:23:38 +01:00
|
|
|
index 9f7f32d..d850dbf 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
|
|
|
|
@@ -783,11 +783,17 @@ public class Chunk {
|
|
|
|
"Chunk coordinates: " + (this.locX * 16) + "," + (this.locZ * 16));
|
|
|
|
e.printStackTrace();
|
|
|
|
ServerInternalException.reportInternalException(e);
|
|
|
|
+
|
|
|
|
+ if (this.world.paperConfig.removeCorruptTEs) {
|
|
|
|
+ this.removeTileEntity(tileentity.getPosition());
|
|
|
|
+ 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);
|
|
|
|
--
|
2016-12-11 00:50:31 +01:00
|
|
|
2.9.3
|
2016-10-05 23:28:17 +02:00
|
|
|
|