SPIGOT-6772: Use entity mailbox and re-schedule entities if they get unloaded

By: DerFrZocker <derrieple@gmail.com>
This commit is contained in:
CraftBukkit/Spigot
2021-11-01 18:54:44 +11:00
parent 1f5735df63
commit 9e3a0e859f
3 changed files with 59 additions and 24 deletions

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/world/level/chunk/storage/EntityStorage.java
+++ b/net/minecraft/world/level/chunk/storage/EntityStorage.java
@@ -33,7 +33,7 @@
@@ -33,10 +33,10 @@
private static final Logger LOGGER = LogManager.getLogger();
private static final String ENTITIES_TAG = "Entities";
private static final String POSITION_TAG = "Position";
@@ -8,7 +8,11 @@
+ public final WorldServer level; // PAIL private -> public
private final IOWorker worker;
private final LongSet emptyChunks = new LongOpenHashSet();
private final ThreadedMailbox<Runnable> entityDeserializerQueue;
- private final ThreadedMailbox<Runnable> entityDeserializerQueue;
+ public final ThreadedMailbox<Runnable> entityDeserializerQueue; // PAIL private -> public
protected final DataFixer fixerUpper;
public EntityStorage(WorldServer worldserver, File file, DataFixer datafixer, boolean flag, Executor executor) {
@@ -51,8 +51,8 @@
if (this.emptyChunks.contains(chunkcoordintpair.pair())) {
return CompletableFuture.completedFuture(b(chunkcoordintpair));