From 0544aa1dd623f59d7aa2380e89a74ee10f4971b1 Mon Sep 17 00:00:00 2001 From: ishland Date: Mon, 30 Oct 2023 21:37:51 +0800 Subject: [PATCH] fix: use the correct distance map for shouldTick checks Fixes an issue where chunk ticking follows client view distance when it shouldn't --- .../mixins/playerwatching/MixinThreadedAnvilChunkStorage.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/ishland/vmp/mixins/playerwatching/MixinThreadedAnvilChunkStorage.java b/src/main/java/com/ishland/vmp/mixins/playerwatching/MixinThreadedAnvilChunkStorage.java index 041cd3d..6002474 100644 --- a/src/main/java/com/ishland/vmp/mixins/playerwatching/MixinThreadedAnvilChunkStorage.java +++ b/src/main/java/com/ishland/vmp/mixins/playerwatching/MixinThreadedAnvilChunkStorage.java @@ -123,7 +123,7 @@ public List getPlayersWatchingChunk(ChunkPos pos) { } else { ImmutableList.Builder builder = ImmutableList.builder(); - for (Object __player : this.areaPlayerChunkWatchingManager.getPlayersWatchingChunkArray(l)) { + for (Object __player : this.areaPlayerChunkWatchingManager.getPlayersInGeneralAreaMap(l)) { if (__player instanceof ServerPlayerEntity serverPlayerEntity) { if (this.canTickChunk(serverPlayerEntity, pos)) { builder.add(serverPlayerEntity); @@ -145,7 +145,7 @@ public boolean shouldTick(ChunkPos pos) { if (!this.ticketManager.shouldTick(l)) { return false; } else { - for (Object __player : this.areaPlayerChunkWatchingManager.getPlayersWatchingChunkArray(l)) { + for (Object __player : this.areaPlayerChunkWatchingManager.getPlayersInGeneralAreaMap(l)) { if (__player instanceof ServerPlayerEntity serverPlayerEntity) { if (this.canTickChunk(serverPlayerEntity, pos)) { return true;