ZoneBox

data class ZoneBox(val id: Int, val firstPos: EffectiveBlockPos, val secondPos: EffectiveBlockPos, val worldUUID: UUID, val owner: UUID? = null)

One axis-aligned box belonging to a zone.

Constructors

Link copied to clipboard
constructor(id: Int, firstPos: EffectiveBlockPos, secondPos: EffectiveBlockPos, worldUUID: UUID, owner: UUID? = null)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

one corner (inclusive)

Link copied to clipboard
val id: Int

unique box id across all zones

Link copied to clipboard
val owner: UUID?

creator, or null when the zone does not remember owners

Link copied to clipboard

opposite corner (inclusive)

Link copied to clipboard

world the box lives in

Functions

Link copied to clipboard
fun getBlocksInside(): List<EffectiveBlockData>

All blocks within the box (inclusive). Iterates the whole volume — costly for large boxes.

Link copied to clipboard
fun getCenter(): Location

Center of the box as a Location (block centers, +0.5 offset).

Link copied to clipboard
fun getEntitiesInside(): List<Entity>

Entities currently inside the box. Note: bounds here are exclusive (strictly between corners).

Link copied to clipboard

Deterministic UUID derived from the box id (used as the render handle).

Link copied to clipboard
fun isInside(location: Location): Boolean

Whether location lies within this box (inclusive bounds, same world).

Link copied to clipboard

Serializes the box to the string form used in persistent data.