Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 2 additions & 11 deletions src/main/kotlin/net/bladehunt/kotstom/extension/PointExt.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand All @@ -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))

Expand Down
Loading