Paper/Spigot-Server-Patches/0302-Mark-chunk-dirty-anytime-entities-change-to-guarante.patch
Zach Brown 8ed2992da9
Make scan-for-legacy-ender-dragon config work again
Portion of diff was dropped in the mappings update commit.

Also remove the option to remove invalid statistics. The server will
automatically do this now as of... 1.13?, our option wasn't even doing anything.
2018-12-14 20:17:27 -05:00

31 lines
1.1 KiB
Diff

From 490ae02b8037545eb9c1984738af7d8f07bf788c Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Mon, 23 Jul 2018 22:18:31 -0400
Subject: [PATCH] Mark chunk dirty anytime entities change to guarantee it
saves
diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java
index bb76f56da..382e46adb 100644
--- a/src/main/java/net/minecraft/server/Chunk.java
+++ b/src/main/java/net/minecraft/server/Chunk.java
@@ -712,6 +712,7 @@ public class Chunk implements IChunkAccess {
entity.ag = this.locZ;
this.entitySlices[k].add(entity);
// Paper start
+ this.markDirty();
if (entity instanceof EntityItem) {
itemCounts[k]++;
} else if (entity instanceof IInventory) {
@@ -743,6 +744,7 @@ public class Chunk implements IChunkAccess {
if (!this.entitySlices[i].remove(entity)) {
return;
}
+ this.markDirty();
if (entity instanceof EntityItem) {
itemCounts[i]--;
} else if (entity instanceof IInventory) {
--
2.20.0