testserver/Spigot-Server-Patches/0299-Mark-chunk-dirty-anyti...

31 lines
1.1 KiB
Diff
Raw Normal View History

From 1219243ef0beb650d17ea1073f32e1100a3102ed 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 e8c06e01b4..5d187e5d7d 100644
--- a/src/main/java/net/minecraft/server/Chunk.java
+++ b/src/main/java/net/minecraft/server/Chunk.java
@@ -718,6 +718,7 @@ public class Chunk implements IChunkAccess {
entity.chunkZ = this.locZ;
this.entitySlices[k].add(entity);
// Paper start
+ this.markDirty();
if (entity instanceof EntityItem) {
itemCounts[k]++;
} else if (entity instanceof IInventory) {
@@ -748,6 +749,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.21.0