Feat/position extension - #429
Conversation
…tions - implement distanceSquared, distance, horizontalDistance, verticalDistance, and related methods - provide functionality for both Position and BlockPosition types - enhance position comparison capabilities with isWithinDistance and isSameBlock methods
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
The new isWithinCube/isWithinSquare implementations contain confirmed Long/Int type mismatches that should fail compilation (and must be corrected before merging).
Get a fresh assessment by requesting another Copilot review.
Review effort: Lite
Findings: 1
Open (2)
What changed in this PR
Adds a new set of Kotlin extension utilities for Paper’s io.papermc.paper.math.Position / BlockPosition types, expanding the Paper-facing API surface with common distance/containment helpers and packed-coordinate conversions. This fits the codebase’s general pattern of providing convenience APIs via Kotlin extensions in platform modules.
Changes:
- Introduces
Position/BlockPositionhelper extensions for distance calculations, comparisons, bounds checks, and string formatting. - Adds pack/unpack helpers for
BlockPosition↔ packedLongrepresentation. - Bumps project version to
3.44.0and updates the Paper API dump accordingly.
| File | Description |
|---|---|
surf-api-paper/surf-api-paper/src/main/kotlin/dev/slne/surf/api/paper/util/position-util.kt |
New position/block-position extension utilities and packed-coordinate helpers. |
surf-api-paper/surf-api-paper/api/surf-api-paper.api |
API dump updated to include the newly exported extensions. |
gradle.properties |
Version bump to 3.44.0. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
- implement horizontalDistanceSquared function to calculate squared distance - only X and Z coordinates are considered for the calculation


No description provided.