Merge 1.19.4 into 1.20

This commit is contained in:
embeddedt 2023-07-11 14:25:35 -04:00
commit 61288a17ac
No known key found for this signature in database
GPG Key ID: A69433EC199B5613

View File

@ -91,15 +91,13 @@ public abstract class ChunkMapMixin {
CompletableFuture<Either<ChunkAccess, ChunkHolder.ChunkLoadingFailure>> future = holder.getOrScheduleFuture(requiredStatus.getParent(), (ChunkMap)(Object)this);
cir.setReturnValue(future.thenComposeAsync((either) -> {
Optional<ChunkAccess> optional = either.left();
if(!optional.isPresent())
return CompletableFuture.completedFuture(either);
if (requiredStatus == ChunkStatus.LIGHT) {
this.distanceManager.addTicket(TicketType.LIGHT, chunkpos, 33 + ChunkStatus.getDistance(ChunkStatus.LIGHT), chunkpos);
}
// from original method
if (optional.get().getStatus().isOrAfter(requiredStatus)) {
if (optional.isPresent() && optional.get().getStatus().isOrAfter(requiredStatus)) {
CompletableFuture<Either<ChunkAccess, ChunkHolder.ChunkLoadingFailure>> completablefuture = requiredStatus.load(this.level, this.structureTemplateManager, this.lightEngine, (arg2) -> {
return this.protoChunkToFullChunk(holder);
}, (ChunkAccess)optional.get());