Skip to content

fix(extension): stop shipping Point helpers Minestom already provides - #21

Merged
oglassdev merged 1 commit into
mainfrom
fix/point-ext-minestom-members
Oct 14, 2026
Merged

oglassdev merged 1 commit into
mainfrom
fix/point-ext-minestom-members

Conversation

@oglassdev

Copy link
Copy Markdown
Owner

Minestom's Point now has asVec(), asPos() and asBlockVec() as members. Kotlin always picks a member over an extension, so KotStom's Point.asVec() and Point.asPos() could never be called, and every point.asVec() was already running Minestom's version. Separately, Vec.roundToBlock() used the BlockVec(Point) constructor, which Minestom marks @Deprecated(forRemoval = true), so it would stop compiling when Minestom removes it.

  • Remove Point.asVec() and Point.asPos(). Behavior doesn't change: Minestom's members return the same values, and also skip the copy when the point is already a Vec or Pos.
  • Vec.roundToBlock() now calls asBlockVec(), and is deprecated with ReplaceWith("asBlockVec()") so users get a one-click migration.
  • Pos.roundToBlock() stays as is, since it keeps yaw and pitch.

Testing

  • compileKotlin, compileTestKotlin and :example:compileKotlin pass, and the three PointExt compiler warnings are gone.

Point now defines asVec() and asPos() itself, so the KotStom extensions
were unreachable. Vec.roundToBlock() used the BlockVec(Point)
constructor, which Minestom marks for removal; it now delegates to
asBlockVec() and is deprecated in favor of it.
@oglassdev
oglassdev merged commit e20a2ac into main Oct 14, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant