EffectiveZone

abstract class EffectiveZone

Base class for a named spatial zone — a logical region made up of one or more box selections.

A subclass declares identity (getNamespacedData), whether boxes remember who created them (doRememberOwner) and the render color (getZoneColor). Like ru.hukm.effectiveSpigot.minecraft.items.EffectiveItem, a zone registers itself on construction and must be instantiated (e.g. from onEnable) to become active.

Boxes are added at runtime via registerSelection (usually from an in-game selection), persisted in the world's persistent data, and restored on server load. As entities move, the framework fires EffectiveZoneEnterEvent, EffectiveZoneExitEvent and EffectiveZoneInsideEvent; listen for these to implement zone behaviour.

A built-in /ezone command manages zone selections and boxes in-game.

Constructors

Link copied to clipboard
constructor()

Types

Link copied to clipboard
object Companion
Link copied to clipboard
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.

Properties

Link copied to clipboard

Boxes currently belonging to this zone (loaded from persistent data on server load).

Functions

Link copied to clipboard
abstract fun doRememberOwner(): Boolean

Whether new boxes should record the player who created them.

Link copied to clipboard
abstract fun getNamespacedData(): Pair<JavaPlugin, String>

Owning plugin and a plugin-unique id; together they form the getNamespacedName.

Link copied to clipboard

Unique identity as "<plugin-name>/<id>", both lowercased.

Link copied to clipboard
abstract fun getZoneColor(): Color

Color used when rendering this zone's boxes.