From 70ccc97b36190b17aa8785a875672d4cb1e64565 Mon Sep 17 00:00:00 2001 From: Spottedleaf Date: Mon, 18 Nov 2024 22:48:40 -0800 Subject: [PATCH] Fix non block ticking chunks not sending block/light updates Needed to redirect the getTickingChunk call in broadcastChangedChunks to use the chunk to send method. --- .../Moonrise-optimisation-patches.patch | 21 +++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/patches/server/Moonrise-optimisation-patches.patch b/patches/server/Moonrise-optimisation-patches.patch index c55e9cc50f..bc526c0bb3 100644 --- a/patches/server/Moonrise-optimisation-patches.patch +++ b/patches/server/Moonrise-optimisation-patches.patch @@ -26486,13 +26486,13 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + + if (ret != null || !ca.spottedleaf.moonrise.common.util.TickThread.isTickThread()) { + return ret; -+ } + } + + final ca.spottedleaf.moonrise.patches.chunk_system.scheduling.NewChunkHolder holder = ((ca.spottedleaf.moonrise.patches.chunk_system.level.ChunkSystemServerLevel)this.level).moonrise$getChunkTaskScheduler() + .chunkHolderManager.getChunkHolder(chunkX, chunkZ); + if (holder == null) { + return ret; - } ++ } + + return ca.spottedleaf.moonrise.common.PlatformHooks.get().getCurrentlyLoadingChunk(holder.vanillaChunkHolder); + // Paper end - rewrite chunk system @@ -26554,15 +26554,15 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + ret.complete(ChunkResult.of(chunk)); + } + }; -+ + +- private boolean chunkAbsent(@Nullable ChunkHolder holder, int maxLevel) { +- return holder == null || holder.oldTicketLevel > maxLevel; // CraftBukkit using oldTicketLevel for isLoaded checks + ((ca.spottedleaf.moonrise.patches.chunk_system.level.ChunkSystemServerLevel)this.level).moonrise$getChunkTaskScheduler().scheduleChunkLoad( + chunkX, chunkZ, leastStatus, true, + ca.spottedleaf.concurrentutil.util.Priority.HIGHER, + complete + ); - -- private boolean chunkAbsent(@Nullable ChunkHolder holder, int maxLevel) { -- return holder == null || holder.oldTicketLevel > maxLevel; // CraftBukkit using oldTicketLevel for isLoaded checks ++ + return ret; + } else { + // can return now @@ -26676,6 +26676,15 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 gameprofilerfiller.pop(); } finally { @@ -0,0 +0,0 @@ public class ServerChunkCache extends ChunkSource { + + while (iterator.hasNext()) { + ChunkHolder playerchunk = (ChunkHolder) iterator.next(); +- LevelChunk chunk = playerchunk.getTickingChunk(); ++ LevelChunk chunk = playerchunk.getChunkToSend(); // Paper - rewrite chunk system + + if (chunk != null) { + playerchunk.broadcastChanges(chunk); +@@ -0,0 +0,0 @@ public class ServerChunkCache extends ChunkSource { } private void collectTickingChunks(List chunks) {