3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-12-21 05:50:05 +01:00
Paper/nms-patches/PlayerChunk.patch

58 Zeilen
2.9 KiB
Diff

2019-04-23 04:00:00 +02:00
--- a/net/minecraft/server/PlayerChunk.java
+++ b/net/minecraft/server/PlayerChunk.java
2019-05-14 02:00:00 +02:00
@@ -43,7 +43,7 @@
this.fullChunkFuture = PlayerChunk.UNLOADED_CHUNK_FUTURE;
2019-04-23 04:00:00 +02:00
this.tickingFuture = PlayerChunk.UNLOADED_CHUNK_FUTURE;
this.entityTickingFuture = PlayerChunk.UNLOADED_CHUNK_FUTURE;
- this.chunkSave = CompletableFuture.completedFuture((Object) null);
+ this.chunkSave = CompletableFuture.completedFuture(null); // CraftBukkit - decompile error
this.dirtyBlocks = new short[64];
this.location = chunkcoordintpair;
this.lightEngine = lightengine;
2019-05-14 02:00:00 +02:00
@@ -76,9 +76,9 @@
2019-04-23 04:00:00 +02:00
@Nullable
public Chunk getChunk() {
CompletableFuture<Either<Chunk, PlayerChunk.Failure>> completablefuture = this.a();
- Either<Chunk, PlayerChunk.Failure> either = (Either) completablefuture.getNow((Object) null);
+ Either<Chunk, PlayerChunk.Failure> either = (Either) completablefuture.getNow(null); // CraftBukkit - decompile error
- return either == null ? null : (Chunk) either.left().orElse((Object) null);
+ return either == null ? null : (Chunk) either.left().orElse(null); // CraftBukkit - decompile error
}
public CompletableFuture<IChunkAccess> getChunkSave() {
2019-05-14 02:00:00 +02:00
@@ -201,7 +201,7 @@
2019-04-23 04:00:00 +02:00
CompletableFuture<Either<IChunkAccess, PlayerChunk.Failure>> completablefuture = (CompletableFuture) this.statusFutures.get(i);
if (completablefuture != null) {
- Either<IChunkAccess, PlayerChunk.Failure> either = (Either) completablefuture.getNow((Object) null);
+ Either<IChunkAccess, PlayerChunk.Failure> either = (Either) completablefuture.getNow(null); // CraftBukkit - decompile error
if (either == null || either.left().isPresent()) {
return completablefuture;
2019-05-14 02:00:00 +02:00
@@ -213,6 +213,15 @@
2019-04-23 04:00:00 +02:00
this.a(completablefuture1);
this.statusFutures.set(i, completablefuture1);
+ // CraftBukkit start
+ if (chunkstatus == ChunkStatus.FULL) {
+ completablefuture1.thenAccept((either) -> {
+ Chunk chunk = (Chunk) either.left().get();
+
+ chunk.loadCallback();
+ });
+ }
+ // CraftBukkit end
return completablefuture1;
} else {
return completablefuture == null ? PlayerChunk.UNLOADED_CHUNK_ACCESS_FUTURE : completablefuture;
2019-05-14 02:00:00 +02:00
@@ -294,7 +303,7 @@
if (flag2 && !flag3) {
completablefuture = this.fullChunkFuture;
this.fullChunkFuture = PlayerChunk.UNLOADED_CHUNK_FUTURE;
- this.a(completablefuture.thenApply((either1) -> {
+ this.a(((CompletableFuture<Either<Chunk, PlayerChunk.Failure>>) completablefuture).thenApply((either1) -> { // CraftBukkit - decompile error
playerchunkmap.getClass();
return either1.ifLeft(playerchunkmap::a);
}));