feat(wc-mcsg): /sgsetup map authoring; explicit-only pedestals + chest fixes #9

Merged
crypt merged 3 commits from sg-map-authoring into main 2026-10-03 19:14:36 +00:00
Owner

Summary

Replaces fragile runtime pedestal detection with an explicit, in-game authoring command, and fixes two chest bugs found in review.

fix(wc-mcsg) — chest correctness

  • refillAll reuses each chest's original fill tier, so an unlooted tier-3 supply drop is no longer downgraded to tier-1 loot at a mid-game refill.
  • setGameWorld clears fill/tier/marker state per match (no stale state across replays).
  • tier2Block/tier3Block now require a chest-family material (CHEST/TRAPPED_CHEST/ENDER_CHEST); anything else is warned and disabled instead of silently never matching (markers are found via chunk tile entities).

feat(wc-mcsg) — /sgsetup map authoring

  • Removed PedestalResolver (marker-block detection + generated ring) and the pedestalBlock/pedestalCount/pedestalRadius map.yml keys. cornucopiaSpawns is now the sole pedestal source; GameManager warns and falls back to the world spawn when a map has none.
  • New staff command /sgsetup (permission wc.command.sgsetup), using the injected WorldLoader:
    • load <map> — loads the world on demand (all game worlds are already in /data/<map> at boot), teleports you there, starts a session. No match/vote needed.
    • center, add [yaw] (yaw auto-faces the centre), dm, drop (player facing), undo (last point of any kind), status, ring <n> [r] (heuristic proposal), finish.
    • finish emits a complete map.yml (captured deathmatch/supply override; otherwise the existing sections are preserved), writes a draft to plugins/wc-mcsg/drafts/<map>-map.yml, and prints the kubectl cp retrieval command.
  • Wired into plugin.yml, WcMcsgPlugin, and PermissionBridge (wildcard list).

docs

  • Full authoring runbook in images/maps/maps/README.md; /sgsetup added to the README staff command table; chart README pointer; corrected marker/refill docs in the chart configmap and spec.

Verification

  • ./gradlew test spotlessCheck (all plugin modules) — 431+ tests, format clean.
  • python3 scripts/test-chart.py — chart regression passed; helm lint + helm template render 42 resources.
  • go vet ./..., go build, go test ./... -short (controller) — all pass.

Not covered

  • The /sgsetup load path touches Bukkit WorldCreator statics, so it is only fake-covered in unit tests. Needs one manual smoke on a real pod (deploy a map with no map.yml → /sgsetup load <map> → center → add×N → finish → kubectl cp → commit).
## Summary Replaces fragile runtime pedestal detection with an explicit, in-game authoring command, and fixes two chest bugs found in review. ### `fix(wc-mcsg)` — chest correctness - `refillAll` reuses each chest's **original fill tier**, so an unlooted tier-3 supply drop is no longer downgraded to tier-1 loot at a mid-game refill. - `setGameWorld` clears fill/tier/marker state per match (no stale state across replays). - `tier2Block`/`tier3Block` now require a chest-family material (`CHEST`/`TRAPPED_CHEST`/`ENDER_CHEST`); anything else is warned and disabled instead of silently never matching (markers are found via chunk tile entities). ### `feat(wc-mcsg)` — `/sgsetup` map authoring - **Removed** `PedestalResolver` (marker-block detection + generated ring) and the `pedestalBlock`/`pedestalCount`/`pedestalRadius` map.yml keys. `cornucopiaSpawns` is now the sole pedestal source; `GameManager` warns and falls back to the world spawn when a map has none. - New staff command `/sgsetup` (permission `wc.command.sgsetup`), using the injected `WorldLoader`: - `load <map>` — loads the world on demand (all game worlds are already in `/data/<map>` at boot), teleports you there, starts a session. No match/vote needed. - `center`, `add [yaw]` (yaw auto-faces the centre), `dm`, `drop` (player facing), `undo` (last point of any kind), `status`, `ring <n> [r]` (heuristic proposal), `finish`. - `finish` emits a complete `map.yml` (captured deathmatch/supply override; otherwise the existing sections are preserved), writes a draft to `plugins/wc-mcsg/drafts/<map>-map.yml`, and prints the `kubectl cp` retrieval command. - Wired into `plugin.yml`, `WcMcsgPlugin`, and `PermissionBridge` (wildcard list). ### `docs` - Full authoring runbook in `images/maps/maps/README.md`; `/sgsetup` added to the README staff command table; chart README pointer; corrected marker/refill docs in the chart configmap and spec. ## Verification - `./gradlew test spotlessCheck` (all plugin modules) — 431+ tests, format clean. - `python3 scripts/test-chart.py` — chart regression passed; `helm lint` + `helm template` render 42 resources. - `go vet ./...`, `go build`, `go test ./... -short` (controller) — all pass. ## Not covered - The `/sgsetup load` path touches Bukkit `WorldCreator` statics, so it is only fake-covered in unit tests. Needs one manual smoke on a real pod (deploy a map with no `map.yml` → `/sgsetup load <map>` → `center` → `add`×N → `finish` → `kubectl cp` → commit).
- refillAll reuses each chest's original fill tier, so an unlooted tier-3
  supply drop is no longer downgraded to tier-1 loot mid-game.
- setGameWorld clears filled/filledTiers/specialChestTiers per match so
  stale locations cannot suppress fills or re-tier chests.
- tier2Block/tier3Block now require a chest-family material (CHEST,
  TRAPPED_CHEST, ENDER_CHEST); anything else is warned and disabled
  instead of silently never matching, since markers are found via chunk
  tile entities and converted to chests.
Runtime pedestal detection (marker block) and the generated-ring fallback
are removed: cornucopia pedestals come only from the explicit map.yml
cornucopiaSpawns list. PedestalResolver and its test are deleted, and
MapDefinition no longer carries pedestalBlock/pedestalCount/pedestalRadius.
GameManager warns and falls back to the world spawn when a map has no
pedestals.

Authoring is now done in-game with the staff command /sgsetup (permission
wc.command.sgsetup), which takes the injected WorldLoader:

  load <map>   load the world on demand (no match needed) + start a session
  center       record the cornucopia centre
  add [yaw]    record a pedestal (yaw defaults to facing the centre)
  dm / drop    record a deathmatch spawn / supply-drop spot (player facing)
  undo         remove the last recorded point of any kind
  status       per-kind counts
  ring <n> [r] generate a pedestal ring proposal (heuristic)
  finish       print + save a complete map.yml

finish emits captured deathmatch/supply points when present (else preserves
the existing file's sections), writes the draft to
plugins/wc-mcsg/drafts/<map>-map.yml, and prints the kubectl cp command.
docs: document /sgsetup map authoring runbook
All checks were successful
/ detect (pull_request) Successful in 11s
/ controller (pull_request) Has been skipped
/ commit-check (pull_request) Successful in 3s
/ plugin (pull_request) Successful in 1m18s
/ chart (pull_request) Successful in 5s
231c7be931
- images/maps/maps/README.md: full authoring runbook (load/center/add/dm/
  drop/finish, kubectl cp retrieval, commit) and note that supply drops
  prefer map.yml supplyDropLocations.
- README.md: add /sgsetup to the staff command table.
- chart/README.md: point at the runbook; note chest-only tier markers.
- chart configmap + spec: correct the marker-block and refill-tier docs.
crypt merged commit 7df29443b3 into main 2026-10-03 19:14:36 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
crypt/k8s-mcsg-uhc!9
No description provided.