From e4d7178a3c7cfc28a13d345d29e79a5040ebd9f5 Mon Sep 17 00:00:00 2001 From: Spottedleaf Date: Tue, 17 Jun 2025 17:53:12 -0700 Subject: [PATCH] Implement WaypointTransmitter#isChunkVisible The Vanilla chunk tracker on Moonrise always returns false. We need to redirect to Moonrise's chunk loader. https://github.com/Tuinity/Moonrise/commit/aef2b81d6e805f6af7d12d904fb88cdca1f721ca --- .../0016-Moonrise-optimisation-patches.patch | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/paper-server/patches/features/0016-Moonrise-optimisation-patches.patch b/paper-server/patches/features/0016-Moonrise-optimisation-patches.patch index ad230d1686d..080b9f54dc8 100644 --- a/paper-server/patches/features/0016-Moonrise-optimisation-patches.patch +++ b/paper-server/patches/features/0016-Moonrise-optimisation-patches.patch @@ -36592,3 +36592,19 @@ index c634d795644be86ad85395ffa39fbac33bf7418b..66d0a6390febe929ef774b0a78133290 int i = -this.pendingTicks.size(); for (SavedTick savedTick : this.pendingTicks) { +diff --git a/net/minecraft/world/waypoints/WaypointTransmitter.java b/net/minecraft/world/waypoints/WaypointTransmitter.java +index b579839c03b371d408e3750ec09af7da1d7bc9a0..9b41c62afc861847571ad739d1dd848b8276230c 100644 +--- a/net/minecraft/world/waypoints/WaypointTransmitter.java ++++ b/net/minecraft/world/waypoints/WaypointTransmitter.java +@@ -31,7 +31,10 @@ public interface WaypointTransmitter extends Waypoint { + } + + static boolean isChunkVisible(ChunkPos pos, ServerPlayer player) { +- return player.getChunkTrackingView().isInViewDistance(pos.x, pos.z); ++ // Paper start - rewrite chunk system ++ final ca.spottedleaf.moonrise.patches.chunk_system.player.RegionizedPlayerChunkLoader.PlayerChunkLoaderData playerChunkLoader = ((ca.spottedleaf.moonrise.patches.chunk_system.player.ChunkSystemServerPlayer)player).moonrise$getChunkLoader(); ++ return playerChunkLoader != null && playerChunkLoader.getSentChunksRaw().contains(ca.spottedleaf.moonrise.common.util.CoordinateUtils.getChunkKey(pos)); ++ // Paper end - rewrite chunk system + } + + static boolean isReallyFar(LivingEntity entity, ServerPlayer player) {