Skip to content

feat(setup): create lobby portals from in-game commands - #329

Merged
TheMeinerLP merged 19 commits into
mainfrom
feat/setup-portals
Sep 29, 2026
Merged

TheMeinerLP merged 19 commits into
mainfrom
feat/setup-portals

Conversation

@TheMeinerLP

Copy link
Copy Markdown
Contributor

Summary

The setup server gets /setup portal so the build team can create the lobby portals from #326 in-game instead of writing JSON by hand.

  • Per-player drafts; nothing is written except by an explicit save. cancel discards a draft, remove deletes a saved portal.
  • list shows saved portals and, separately, the player's open drafts. show draws the outlines as particles, only for the executing player.
  • Box from two corners (pos1/pos2, block-inclusive). Ring from eye position and look direction (centre rounded to 0.5, normal snapped to an axis within 5 degrees) plus a radius. Every portal has a task and an optional permission.
  • Guided flow /setup portal create <id> with clickable buttons. Each button runs an existing sub-command, so the flow is a thin layer over the commands and not a second code path. Buttons are built with the Adventure API, never with MiniMessage click tags around player text.
  • Live particle preview while a draft is open (max 256 points, per player, cleaned up on save, cancel and quit).
  • Tab completion: ids, tasks taken from saved portals, radii, none.
  • Validation reuses core PortalValidator.problems(...), the same rules that abort the lobby's startup, so an invalid portal is never written. Saving keeps spawn, name, authors and the other portals.

Notes

  • Messages are English in the MapCommand style (the repository has no i18n infrastructure).
  • /setup has no permission check yet (follow-up).
  • The lobby reads portals only at startup, so it needs a restart after edits.
  • A wand item is a possible follow-up.
  • README: new "Portals" subsection under the setup server docs.

Tests

New test classes under setup/src/test: DiscPlacementTest, PortalEditorTest, PortalEditorValidatorParityTest, PortalMessagesTest, PortalEditorLoggingTest, PortalOutlineTest, DraftOutlineTest, MapProviderPortalStoreTest, DraftPointsTest, PortalShowTest, DraftPreviewTest, PortalCommandTest, PortalFlowTest, PortalCompletionsTest.

./gradlew build is green. The manual in-game check (clickable buttons, tab completion in the real client) is still pending and will be done before merge.

OpenSpec

openspec/changes/setup-portal-command

https://claude.ai/code/session_01A7aAe2E6wAEbi6jjnyPTWH

@TheMeinerLP
TheMeinerLP requested a review from a team as a code owner September 29, 2026 18:48
@github-actions

github-actions Bot commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

Test results

  345 files    345 suites   21m 10s ⏱️
  729 tests   728 ✅ 1 💤 0 ❌
2 187 runs  2 184 ✅ 3 💤 0 ❌

Results for commit 19f7bb9.

♻️ This comment has been updated with latest results.

@TheMeinerLP

Copy link
Copy Markdown
Contributor Author

Manual in-game test passed (local setup server + local lobby, offline mode):

  • Guided flow /setup portal create: all buttons (shape, set corner/centre, radius, task, permission, save) worked in the real client; tab completion worked.
  • Saved a ring (disc, radius 9, normal snapped to -x) and a box portal; map.json kept spawn/name/builders.
  • Lobby (feat(portal): switch servers by walking or flying through portals #326) delivered once per pass through both portals (DebugDeliver), in world and — with the portals copied by hand — in the halloween season world.

https://claude.ai/code/session_01A7aAe2E6wAEbi6jjnyPTWH

@TheMeinerLP
TheMeinerLP merged commit aad7bcb into main Sep 29, 2026
12 of 13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant