diff options
author | Spottedleaf <[email protected]> | 2024-06-16 14:09:44 -0700 |
---|---|---|
committer | Spottedleaf <[email protected]> | 2024-06-16 14:09:44 -0700 |
commit | f8ee0a06c563864f1f703937155a9c27e1c93eb0 (patch) | |
tree | 15f133d5c43a1a6481c96f3a272ce5890ac731a9 /patches/server/1005-Improve-cancelling-PreCreatureSpawnEvent-with-per-pl.patch | |
parent | d9111ccec278132052cebdebca9f1c6dcaba9512 (diff) | |
download | Paper-f8ee0a06c563864f1f703937155a9c27e1c93eb0.tar.gz Paper-f8ee0a06c563864f1f703937155a9c27e1c93eb0.zip |
Fix implementations of ChunkHolder#getChunkIfPresent
Implementations for ChunkStatuses below FULL are supposed to always
return ProtoChunk instances. However, since we used the last completed
status, it could return LevelChunk.
To resolve this, follow Vanilla behavior of tracking chunk
completions by status and replace old ProtoChunk statuses with
ImposterProtoChunk when the chunk generates to FULL.
Additionally, implement an optimisation for retrieving full chunks
by storing a map of pos -> LevelChunk. This requires only a simple
map lookup to occur for full chunks which are loaded.
Diffstat (limited to 'patches/server/1005-Improve-cancelling-PreCreatureSpawnEvent-with-per-pl.patch')
-rw-r--r-- | patches/server/1005-Improve-cancelling-PreCreatureSpawnEvent-with-per-pl.patch | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/patches/server/1005-Improve-cancelling-PreCreatureSpawnEvent-with-per-pl.patch b/patches/server/1005-Improve-cancelling-PreCreatureSpawnEvent-with-per-pl.patch index 410b44641b..ab570def0a 100644 --- a/patches/server/1005-Improve-cancelling-PreCreatureSpawnEvent-with-per-pl.patch +++ b/patches/server/1005-Improve-cancelling-PreCreatureSpawnEvent-with-per-pl.patch @@ -37,10 +37,10 @@ index 7bebf252887ecc7594b1ce21471fb6ba7aa2c051..df00ea382915480be1279a5347872cf7 } // Paper end diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java -index f134b75b3665b53ef873404b3f4775657cfbcadb..7dc2ecd8a80b063cec922021bd978ba2c6f8c0fb 100644 +index a5d465a81ba6ba7dea352005bf02ae2ae424ed14..681fdab250d924a29ca160acffbcbf7f8a3ca78a 100644 --- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java +++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java -@@ -505,7 +505,17 @@ public class ServerChunkCache extends ChunkSource { +@@ -523,7 +523,17 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon if ((this.spawnFriendlies || this.spawnEnemies) && this.level.paperConfig().entities.spawning.perPlayerMobSpawns) { // don't count mobs when animals and monsters are disabled // re-set mob counts for (ServerPlayer player : this.level.players) { |