mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-01 12:41:50 +01:00
5d8b3d4969
Spigot had code that returned early in chunk add/remove methods. This was causing our code added to set current chunks and counts to be skipped over if the entity was default not persistent but made persistent. This was the source of many issues Fixes #1208
46 lines
1.9 KiB
Diff
46 lines
1.9 KiB
Diff
From da23bbc651183f13e725c4a1c85043f06b3164c1 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
|
|
|
|
|
|
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
|
index ce848d63e..93b0af036 100644
|
|
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
|
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
|
@@ -379,4 +379,9 @@ public class PaperWorldConfig {
|
|
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
|
|
index 798522fa7..ee6c6af94 100644
|
|
--- a/src/main/java/net/minecraft/server/Chunk.java
|
|
+++ b/src/main/java/net/minecraft/server/Chunk.java
|
|
@@ -819,11 +819,18 @@ 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());
|
|
+ this.markDirty();
|
|
+ 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);
|
|
--
|
|
2.18.0
|
|
|