feat(base): enforce configurable spawn distance
Release / release (push) Successful in 3m7s
CI / build (push) Successful in 1m43s

This commit is contained in:
dmg
2026-09-12 08:35:29 -04:00
parent 745d09e5a6
commit 8fc4075276
12 changed files with 746 additions and 19 deletions
+5
View File
@@ -43,6 +43,8 @@ The plugin JAR is written to `build/libs/`.
`/basesettings` and `/basesettings ui` open Minecraft's native dialog dashboard. The dashboard summarizes Base and Pocket Base progression, provides unlocked setting controls and purchase confirmations, marks unavailable controls as locked, and provides Back buttons from nested screens. `/basesettings status` retains the detailed chat report.
`/setbase` and `/sethome` require the proposed normal base center (the player's block coordinates) to be at least 100 blocks horizontally from the current world's spawn by default. Height and base radius do not affect this check; exactly the minimum is allowed. Rejection reports the remaining distance rounded up and leaves the existing base and relocation cooldown unchanged. This is a placement-only rule: existing bases are never rechecked when players move or spawn changes, and Pocket Base restrictions are unchanged.
Navigation particles appear only in the base's world and when the player is more than 25 blocks beyond the current base border.
After 250 Survival-mode block placements anywhere by default, the spawnable overlay can mark nearby dark hostile-mob spawning surfaces inside the player's base with owner-only red particles. The threshold is configurable.
@@ -66,11 +68,14 @@ The `spigotbase.admin` permission is granted to server operators by default. `/h
/baseadmin setsetting <player> spawnable <enable|disable>
/baseadmin config <numeric-key> <value>
# e.g. /baseadmin config spawnable-overlay-unlock-placements 250
/baseadmin config minimum-spawn-distance 100
/baseadmin clearcooldown <player> [personal|visitor|all]
/baseadmin reset <player> <size|flight|warmup|cooldown>
/baseadmin reset <player> all confirm
```
`minimum-spawn-distance` is global and defaults to 100 blocks, including legacy configs without the key. It accepts whole numbers from `0` through `2147483647` (the same 32-bit representation used for spatial settings); overflow and invalid values are rejected without changes. `0` disables the spawn-distance restriction. Successful admin updates are confirmed and saved to `config.yml` for restarts, and affect only subsequent normal base placements—not existing bases. Numeric config writes run off the server tick thread using an isolated YAML snapshot and atomic replacement where supported. Live settings and the success reply change only after the write succeeds; failure leaves live settings unchanged. While a save is pending, another config update receives a retry message rather than overwriting settings with a stale snapshot. `/homeadmin` supports the same command and permission-aware key completion.
Default thresholds and durations are documented in `src/main/resources/config.yml`. Durable UUID-keyed state is stored in `plugins/SpigotBase/state.yml` using atomic replacement where supported.
## Releases