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

@ -40,10 +40,10 @@ index 261943f1f188643793a72bd239dfc5fe604e3b99..985ba48a5ac027d3c3dcd9b710b53748
return true;
diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
index 4a0fedff38f12ec87905558a100f1772cee03dd4..c9efcb6170e9ecc615ab70594954fae24ba46ac4 100644
index 2e2976efcf99de269f67dec2c87cb910ff280562..5749698b0c9647295e0be6f7d532d39c18432539 100644
--- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java
+++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
@@ -498,6 +498,15 @@ public class ServerChunkCache extends ChunkSource {
@@ -501,6 +501,15 @@ public class ServerChunkCache extends ChunkSource {
List list1;
if (flag && (this.spawnEnemies || this.spawnFriendlies)) {