Fix and optimize getChunkCount (#11610)

It was returning ticking chunk count instead of the intended full chunk count.
We can also directly use the size of the fullChunks collection instead of iterating all chunks.
This commit is contained in:
Jason Penilla 2024-11-11 12:17:36 -07:00 committed by GitHub
parent 52fb26524e
commit 661839e033
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
36 changed files with 131 additions and 136 deletions

View file

@ -302,10 +302,10 @@ index 0000000000000000000000000000000000000000..95d6022c9cfb2e36ec5a71be6e343540
+ }
+}
diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
index 43e01db5314452c194d2809fdc6a71c6fb42d8d2..76cb7ffad02dcc27966ca13da6552edbb696e41f 100644
index 758b874424b1fed90893132e5455a683b789ebf2..0a895055ec7f61d3cb52d303bbe3f89486a322e7 100644
--- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java
+++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
@@ -218,6 +218,7 @@ public class ServerChunkCache extends ChunkSource {
@@ -221,6 +221,7 @@ public class ServerChunkCache extends ChunkSource {
Objects.requireNonNull(completablefuture);
chunkproviderserver_b.managedBlock(completablefuture::isDone);