mirror of
https://github.com/PaperMC/Paper.git
synced 2025-07-26 09:42:06 -07:00
Implement WaypointTransmitter#isChunkVisible
The Vanilla chunk tracker on Moonrise always returns false. We need
to redirect to Moonrise's chunk loader.
aef2b81d6e
This commit is contained in:
@@ -36592,3 +36592,19 @@ index c634d795644be86ad85395ffa39fbac33bf7418b..66d0a6390febe929ef774b0a78133290
|
||||
int i = -this.pendingTicks.size();
|
||||
|
||||
for (SavedTick<T> 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) {
|
||||
|
Reference in New Issue
Block a user