Skip to content

Commit

Permalink
add method for finding section center
Browse files Browse the repository at this point in the history
  • Loading branch information
Boy0000 committed Sep 21, 2022
1 parent 940888d commit 793895b
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -103,3 +103,6 @@ fun Section.isOnTopOf(other: Section) = key == other.aboveKey

/** Whether a section is adjacent to another */
fun Section.isAdjacentTo(other: Section) = this.isOnTopOf(other) || other.isOnTopOf(this)

val Section.centerLocation: Location
get() = Location(world, region.center.x.toDouble(), region.center.y.toDouble(), region.center.z.toDouble())

0 comments on commit 793895b

Please sign in to comment.