From ad3d4d0f93a152bba0a6cf74c95262c401d5d8ec Mon Sep 17 00:00:00 2001 From: oglassdev <23040613+oglassdev@users.noreply.github.com> Date: Wed, 14 Oct 2026 18:38:35 -0400 Subject: [PATCH] fix(extension): drop Point extensions shadowed by Minestom members 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. --- .../net/bladehunt/kotstom/extension/PointExt.kt | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/src/main/kotlin/net/bladehunt/kotstom/extension/PointExt.kt b/src/main/kotlin/net/bladehunt/kotstom/extension/PointExt.kt index ca4c5be..e5bd694 100644 --- a/src/main/kotlin/net/bladehunt/kotstom/extension/PointExt.kt +++ b/src/main/kotlin/net/bladehunt/kotstom/extension/PointExt.kt @@ -23,16 +23,6 @@ operator fun Pos.component4() = this.yaw operator fun Pos.component5() = this.pitch -fun Point.asVec(): Vec = Vec(this.x(), this.y(), this.z()) - -fun Point.asPos(): Pos = - Pos( - this.x, - this.y, - this.z, - if (this is Pos) this.yaw else 0f, - if (this is Pos) this.pitch else 0f) - fun Pos.roundToBlock(): Pos = Pos( this.blockX().toDouble(), @@ -41,7 +31,8 @@ fun Pos.roundToBlock(): Pos = this.yaw, this.pitch) -fun Vec.roundToBlock(): BlockVec = BlockVec(this) +@Deprecated("Use Minestom's asBlockVec()", ReplaceWith("asBlockVec()")) +fun Vec.roundToBlock(): BlockVec = asBlockVec() fun Vec.rotateAroundXDegrees(degrees: Double) = rotateAroundX(degrees * (PI / 180))