mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-28 23:38:25 +01:00
3c8a4cb1bb
Should fix #1280 Citizens hijacks entity map, and im guessing under the right conditions the result might actually be null during entity creation Pre the cache patch, the id is looked up on save, so it was fine. Now, if its null and the save ID is requested, we will try to look it up again and cache it if found.
28 lines
No EOL
1.1 KiB
Diff
28 lines
No EOL
1.1 KiB
Diff
From 0000000000000000000000000000000000000000 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 7a62fae332..eaee492010 100644
|
|
--- a/src/main/java/net/minecraft/server/Chunk.java
|
|
+++ b/src/main/java/net/minecraft/server/Chunk.java
|
|
@@ -0,0 +0,0 @@ public class Chunk {
|
|
entity.ad = this.locZ;
|
|
this.entitySlices[k].add(entity);
|
|
// Paper start
|
|
+ this.markDirty();
|
|
entity.setCurrentChunk(this);
|
|
entityCounts.increment(entity.getMinecraftKeyString());
|
|
if (entity instanceof EntityItem) {
|
|
@@ -0,0 +0,0 @@ public class Chunk {
|
|
|
|
// Paper start
|
|
if (!this.entitySlices[i].remove(entity)) { return; }
|
|
+ this.markDirty();
|
|
entity.setCurrentChunk(null);
|
|
entityCounts.decrement(entity.getMinecraftKeyString());
|
|
if (entity instanceof EntityItem) {
|
|
--
|