Skip to content

Commit

Permalink
fix: properly update chunk filters when updating view distances
Browse files Browse the repository at this point in the history
  • Loading branch information
ishland committed Oct 27, 2023
1 parent 81a31d3 commit 1e74c7e
Showing 1 changed file with 3 additions and 1 deletion.
Expand Up @@ -60,8 +60,8 @@ public void tick() {
if (vdTracking.isClientViewDistanceChanged()) {
vdTracking.getClientViewDistance();
final long pos = entry.getLongValue();
this.movePlayer(pos, player);
player.setChunkFilter(ChunkFilter.cylindrical(new ChunkPos(pos), this.getViewDistance(player)));
this.movePlayer(pos, player);
}
}

Expand All @@ -74,6 +74,8 @@ public void setWatchDistance(int watchDistance) {
final Object2LongMap.Entry<ServerPlayerEntity> entry = iterator.next();
// if (this.isWatchDisabled(entry.getKey())) continue;

entry.getKey().setChunkFilter(ChunkFilter.cylindrical(new ChunkPos(entry.getLongValue()), this.getViewDistance(entry.getKey())));

this.playerAreaMap.update(
entry.getKey(),
MCUtil.getCoordinateX(entry.getLongValue()),
Expand Down

0 comments on commit 1e74c7e

Please sign in to comment.