System Map — overview
The machine, end to end. The main systems and how they fit together.
Despawn relocation pipeline (the core)
Input: a ground item reaching its despawn timer (ItemDespawnEvent).
OnItemDespawnEventclones the item and enqueues it intoDespawnScheduler.DespawnSchedulerdrains the queue once per tick, starting at mostperformance.max-per-tickrelocations and never exceedingperformance.max-concurrentin flight (queue capped byperformance.max-queue). This is the large-server throttle.- Each relocation is a
DespawnProcess: it draws random, not-yet-tried despawn locations fromLocationManager, async-loads the chunk, and offers the item to each strategy inplugin.strategiesin order:Void → Cooker → BlockIntoAir → ItemIntoEntity → Storage. - On a partial/full placement,
DespawnEffectplays the configured sound + particles.
Output: the item is placed into a container/cooker/entity/air, destroyed (contraband), or dropped (no space found within the budget).
Location store & persistence
LocationManager(plugin.locations) is the façade. It holds aLocationStore(spatial index block→owners, owner index owner→locations, flat bag for O(1) random draw) and aLocationRepository.- Mutations mark the owner dirty and schedule a debounced async flush; disable and
/despi saveflush synchronously. StorageFactorybuilds the repository fromstorage.type:YamlLocationRepository(per-owner files) orJdbcLocationRepository(SQLite / MySQL via HikariCP), migrating YAML → DB on first switch.
Limits & permissions
DespawnLimitsresolves a player's cap fromlimits.unlimited/despi.limit.bypass/ the highestdespi.limit.<n>permission /limits.default./despi addenforces it for self-service adds; admins (despi.elevated) adding for others are uncapped.
Commands
/despidispatches to registered subcommands (OnDespiCommand→AbstractDespiCommandimplementations): add, remove, clear, exists, locations, purge, despawn, effects, reload, save./recycledespawns the held item and tracks reward progress in the player's PDC.
Bulk purge
RemoveMaterialswalks the relevant locations one per tick, removing matching materials/items from each via the same strategies (reverse of placement).