From 7c3194af850b02ced405075de3233902089271d6 Mon Sep 17 00:00:00 2001 From: Spottedleaf Date: Sat, 13 Jul 2024 11:44:52 -0700 Subject: [PATCH] Update last chunk position in findSupportingBlock Fixes fetching chunks needlessly multiple times. Thanks Lulu13022002 for pointing this out --- patches/server/Moonrise-optimisation-patches.patch | 2 ++ 1 file changed, 2 insertions(+) diff --git a/patches/server/Moonrise-optimisation-patches.patch b/patches/server/Moonrise-optimisation-patches.patch index 398647202..af1428d98 100644 --- a/patches/server/Moonrise-optimisation-patches.patch +++ b/patches/server/Moonrise-optimisation-patches.patch @@ -31694,6 +31694,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + final int newChunkZ = currZ >> 4; + + if (((newChunkX ^ lastChunkX) | (newChunkZ ^ lastChunkZ)) != 0) { ++ lastChunkX = newChunkX; ++ lastChunkZ = newChunkZ; + lastChunk = (LevelChunk)chunkSource.getChunk(newChunkX, newChunkZ, ChunkStatus.FULL, false); + } +