SPIGOT-6547: Chunk#getEntities() doesn't return all entities immediately after chunk load

By: DerFrZocker <derrieple@gmail.com>
This commit is contained in:
CraftBukkit/Spigot
2021-09-01 18:55:18 +10:00
parent 768b5d52aa
commit 5c075d59dc
4 changed files with 165 additions and 14 deletions

View File

@@ -0,0 +1,22 @@
--- a/net/minecraft/world/level/chunk/storage/EntityStorage.java
+++ b/net/minecraft/world/level/chunk/storage/EntityStorage.java
@@ -33,7 +33,7 @@
private static final Logger LOGGER = LogManager.getLogger();
private static final String ENTITIES_TAG = "Entities";
private static final String POSITION_TAG = "Position";
- private final WorldServer level;
+ public final WorldServer level; // PAIL private -> public
private final IOWorker worker;
private final LongSet emptyChunks = new LongOpenHashSet();
private final ThreadedMailbox<Runnable> entityDeserializerQueue;
@@ -51,8 +51,8 @@
if (this.emptyChunks.contains(chunkcoordintpair.pair())) {
return CompletableFuture.completedFuture(b(chunkcoordintpair));
} else {
- CompletableFuture completablefuture = this.worker.b(chunkcoordintpair);
- Function function = (nbttagcompound) -> {
+ CompletableFuture<NBTTagCompound> completablefuture = this.worker.b(chunkcoordintpair); // CraftBukkit - decompile error
+ Function<NBTTagCompound, ChunkEntities<Entity>> function = (nbttagcompound) -> { // CraftBukkit - decompile error
if (nbttagcompound == null) {
this.emptyChunks.add(chunkcoordintpair.pair());
return b(chunkcoordintpair);