Claims
A claim is a single chunk owned by a town. Claims are independent rows in the claims table; there is no contiguity requirement on the schema level, but the adjacency rule is enforced when claiming.
Claim model
Field | Type | Description |
|---|---|---|
| UUID | Primary key. |
| UUID | Owning town. |
| int | Chunk coordinates. |
| String | World name. |
| UUID | Source server. |
| long | Timestamp. |
ClaimService keeps a chunk-key → claim lookup in Redis and Caffeine, so per-chunk owner queries (TownAPI.findTownByChunk) are O(1).
Claiming
Configuration knobs (config.yml > claim)
Field | Meaning |
|---|---|
| Chunks. World-spawn buffer. |
| Chunks between this town and any other. |
| Hard cap. |
| The first N claims cost zero regardless of the formula. |
| AstralCore expression. Variables: |
A typical formula:
That yields 100, 200, 300, … per additional claim. Set to $e(0) to disable the economy gate.
Unclaiming
The town spawn is reset if the unclaimed chunk contained it.
Auto-claim
Toggles a per-player auto-claim flag. While active, every chunk the player enters is claimed as long as all the standard checks pass. The flag is cleared on TownExitEvent and on quit.
Auto-claim swallows a chunk's worth of failures silently except for AUTO_CLAIM_FAILED_WORLD and AUTO_CLAIM_ENABLED / AUTO_CLAIM_DISABLED toggle messages.
Wilderness
Unclaimed land falls back to config.yml > wilderness:
Players entering wilderness see the title / subtitle. The permissions set acts as the wilderness role — what anyone can do — and the settings set decides which environment behaviours stay on.
Listener-driven enforcement
PermissionListener and SettingsListener (see Events) run on every relevant Bukkit event. They resolve the chunk to a claim, then the claim to a town, then check the player's role permissions and the town's settings. Both listeners short-circuit when the player has town.admin.
Particle visualisation
/town particles toggles a per-player overlay rendered by ParticleViewTask. Lines mark the edge of each adjacent claim. Disabled in worlds where claims are disabled (PARTICLES_VIEW_DISABLED_IN_WORLD).
BlueMap integration
When BlueMap is present, BlueMapHook groups each town's claims into continuous polygons (via the Cheese library), extrudes them to show height, and labels them with the town name. The detail tooltip is the map-town-detail field in config.yml, MiniMessage with placeholders.
The refresh job runs every 72 000 ticks (≈1 hour) and on world load.