Skip to content

Commit

Permalink
Add some documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
esotericenderman committed Oct 29, 2024
1 parent deeddbe commit 86e5c3c
Showing 1 changed file with 15 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,28 @@ package foundation.esoteric.minecraft.plugins.library.utility.types
import org.bukkit.Location
import org.bukkit.block.Block

/**
* A utility class that represents the location of one block.
* @param worldName The name of the world that this block is located in.
* @param x The x location of this block.
* @param y The y location of this block.
* @param z The z location of this block.
*/
class BlockLocation(val worldName: String, val x: Int, val y: Int, val z: Int) {
/**
* Gets the location of the block at this Location.
* @param location The location to get the block location of.
*/
constructor(location: Location) : this(
location.world.name,
location.x.toInt(),
location.y.toInt(),
location.z.toInt()
)

/**
* Gets the location of this block.
* @param block The block to get the BlockLocation of.
*/
constructor(block: Block) : this(block.location)
}

0 comments on commit 86e5c3c

Please sign in to comment.