Fix incorrect Astral Map distance (measured from interior player position)#2156
Merged
drtheodor merged 1 commit intoJul 16, 2026
Merged
Conversation
The structure/biome finders are only reachable from inside the TARDIS interior dimension, but the reported distance was computed against player.getPos() (interior coords) while the located result is in the target world. Measure from the TARDIS exterior position instead. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
About the PR
The Astral Map's structure and biome finders reported wildly wrong "blocks away" numbers — the issue shows ~10,741 for a structure ~600 blocks away, and a second case of ~12,000 where ~1,658 was expected (the non-constant ratio ruled out a simple unit error).
I couldn't reproduce it live (no client in my build environment), so this is a reasoned fix against the coordinate model plus the reporter's numbers rather than an observed in-game before/after — worth a maintainer sanity-check in-game before merge.
Disclosure: this contribution was made with AI assistance (Claude), reviewed and built by a human-directed process before submission.
Why / Balance
Fixes #2029.
Technical details
Root cause is a coordinate-space mix-up. Both
handleStructureRequestandhandleBiomeRequestinAstralMapBlock.javaonly run when the player is inside the TARDIS interior dimension (they're guarded byTardisServerWorld.isTardisDimension(world)). The search runs in the target world from the TARDIS's exterior position (tPos.getPos()/currentPos.getPos()), and the located structure/biome is a coordinate in that target world — but the distance was computed againstplayer.getPos(), which is the player's position in the interior dimension, an unrelated coordinate space. Subtracting interior coords from target-world coords produces the garbage distance.The fix measures the distance from the TARDIS's exterior search origin (the same reference the result was located from and reported relative to), in both finders:
newPos.getSquaredDistance(player.getPos())→newPos.getSquaredDistance(tPos.getPos())locatedBiome.getSquaredDistance(player.getPos())→locatedBiome.getSquaredDistance(start)(
tPos.getPos()rather than the localposbecauseposis reassigned and so isn't capturable by the asyncthenOnServerThreadlambda; it holds the identical value.)Media
Requirements
Breaking changes
None
Changelog
🆑