LocationManager

Owns the in-memory LocationStore and the persistent LocationRepository, and is the single entry point the rest of the plugin uses to read and mutate despawn locations.

Persistence is incremental and debounced: a mutation marks its owner dirty and schedules a flush a few seconds later; the flush snapshots the dirty owners on the main thread and writes them off-thread. A synchronous shutdown/saveNow path exists for plugin disable and /despi save, when async tasks can't run.

Constructors

Link copied to clipboard
constructor(plugin: PaperMcDespawnedItems)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
val count: Int
Link copied to clipboard

Functions

Link copied to clipboard
fun add(location: Location, owner: UUID): Boolean
Link copied to clipboard
Link copied to clipboard
fun anyAt(location: Location): Boolean
Link copied to clipboard
fun atLocation(location: Location): List<DespawnLocation>
Link copied to clipboard
fun clearAll(): Int
Link copied to clipboard
fun countOfOwner(owner: UUID): Int
Link copied to clipboard
Link copied to clipboard
fun has(location: Location, owner: UUID): Boolean
Link copied to clipboard
Link copied to clipboard
fun load()

Builds the configured backend and loads all locations into memory.

Link copied to clipboard
Link copied to clipboard
fun ownersAt(location: Location): Set<UUID>
Link copied to clipboard
Link copied to clipboard
fun reload()

Flushes, closes the current backend, and reloads (used by /despi reload).

Link copied to clipboard
fun remove(location: Location, owner: UUID): Boolean
Link copied to clipboard
fun removeAllAt(location: Location): Int
Link copied to clipboard
Link copied to clipboard
fun removeOneAt(location: Location): Boolean

Removes one (arbitrary) owner's entry at location.

Link copied to clipboard

Removes one (arbitrary) location owned by owner.

Link copied to clipboard

Replaces the whole store (used by solo-mode testing); marks everything dirty.

Link copied to clipboard
fun saveNow()

Forces a synchronous flush of everything dirty (used by /despi save).

Link copied to clipboard
fun shutdown()

Synchronously flushes and closes the backend (used on plugin disable).