mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-23 11:06:29 +01:00
Mark chunk dirty on entity changes
This is to hopefully help avoid any chunk saving entity issues. Marks the chunk that it NEEDS to be saved, ensuring the latest state gets saved.
This commit is contained in:
parent
9ec7ffa358
commit
ba80c7e580
@ -0,0 +1,30 @@
|
||||
From 37c0cfe11574838ad8c24863a4b926e0b88878d5 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 b31c301ec..6de053781 100644
|
||||
--- a/src/main/java/net/minecraft/server/Chunk.java
|
||||
+++ b/src/main/java/net/minecraft/server/Chunk.java
|
||||
@@ -683,6 +683,7 @@ public class Chunk {
|
||||
entity.ad = this.locZ;
|
||||
this.entitySlices[k].add(entity);
|
||||
// Paper start
|
||||
+ this.markDirty();
|
||||
entity.setCurrentChunk(this);
|
||||
entityCounts.increment(entity.entityKeyString);
|
||||
if (entity instanceof EntityItem) {
|
||||
@@ -725,6 +726,7 @@ public class Chunk {
|
||||
|
||||
// Paper start
|
||||
if (!this.entitySlices[i].remove(entity)) { return; }
|
||||
+ this.markDirty();
|
||||
entity.setCurrentChunk(null);
|
||||
entityCounts.decrement(entity.entityKeyString);
|
||||
if (entity instanceof EntityItem) {
|
||||
--
|
||||
2.18.0
|
||||
|
Loading…
Reference in New Issue
Block a user