Skip to content

feat(navigator): teleport in front of the portal on right click - #414

Merged
TheMeinerLP merged 1 commit into
mainfrom
feat/navigator-portal-teleport
Oct 12, 2026
Merged

TheMeinerLP merged 1 commit into
mainfrom
feat/navigator-portal-teleport

Conversation

@TheMeinerLP

Copy link
Copy Markdown
Contributor

Behaviour

  • Left click (and every click type other than right): unchanged, connects to the CloudNet task.
  • Right click / shift-right click on a destination: closes the inventory and teleports the player in front of the lobby portal whose Portal.task() equals Destination.task(), facing the portal centre.
  • No matching portal in the loaded lobby map: right click falls back to connecting.
  • isAllowed applies to every click type as before; the spawn entry is untouched.
  • Telemetry: new Selection.TELEPORTED (teleported); the fallback is recorded as sent.

Implementation

  • PortalApproach (core, pure geometry): front side is the side of the portal's label (map author puts it where players approach), else the side the player is on. Box: nearest face (normalised by half extents), 2 blocks clear of the face, feet at the box floor. Disc: horizontal part of the normal, signed towards the front, 2 blocks clear of the plane; near-horizontal discs use the direction to the player and stand outside the rim; feet at the ring's lowest point. Yaw/pitch look from eye height at the portal centre.
  • NavigatorModule takes the existing LobbyPortals bean (no cycle; the column declares it in requires).

Tests

  • PortalApproachTest: each shape, side selection, label precedence, never inside/entering the trigger, looks at the centre.
  • NavigatorPortalTeleportTest (Minestom Env): right click teleports, spot outside the trigger, no portal falls back, left and shift click connect, denied right/left click does nothing.
  • NavigatorTelemetryTest: teleported and fallback sent.

https://claude.ai/code/session_01GXose9rakuRNZoM3TP3xj1

@TheMeinerLP
TheMeinerLP requested a review from a team as a code owner October 11, 2026 07:22
@github-actions

Copy link
Copy Markdown
Contributor

Test results

  873 files    873 suites   41m 14s ⏱️
2 374 tests 2 372 ✅  2 💤 0 ❌
7 150 runs  7 067 ✅ 83 💤 0 ❌

Results for commit 834d69c.

@TheMeinerLP
TheMeinerLP merged commit d0afe9b into main Oct 12, 2026
8 checks passed
@TheMeinerLP
TheMeinerLP deleted the feat/navigator-portal-teleport branch October 12, 2026 19:19
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