Skip to content

Notify the sign owner when a warp falls back to the sign block - #165

Merged
tastybento merged 1 commit into
developfrom
fix/notify-owner-on-fallback-warp
Jul 29, 2026
Merged

Notify the sign owner when a warp falls back to the sign block#165
tastybento merged 1 commit into
developfrom
fix/notify-owner-on-fallback-warp

Conversation

@tastybento

Copy link
Copy Markdown
Member

What

warpPlayer(world, user, owner) has two teleport paths:

  • Normal: when the spot in front of the sign passes isSafeLocation, the visitor is warped there via the private warpPlayer(...), which fires WarpInitiateEvent, respects vanished players, plays the sound after a successful teleport, and sends the sign owner warps.player-warped.
  • Fallback: when no safe spot in front exists, the visitor was teleported directly onto the sign's own block — with no event, no vanish check, and no owner notification.

This PR routes the fallback through the same completion path as a normal warp, so behavior is identical wherever the visitor lands. The sign's facing is now also used for the arrival yaw in the fallback, matching normal warps.

Why

Server admins noticed that island owners get "X warped to your warp sign!" in AOneBlock but never in ChunkBlock. The cause is geometry: a ChunkBlock island starts as a single chunk, so warp signs typically sit at the platform edge with void in front — isSafeLocation(inFront) fails and the silent fallback always runs. The same silent path can trigger in any gamemode whenever the block in front of a sign is unsafe.

Testing

Full suite passes (79 tests). The sign-specific branches aren't reachable in unit tests because MockBukkit doesn't populate the sign Tag constants, so this was verified by inspection; a manual test on a ChunkBlock island (warp sign at the platform edge, void in front) is the reproduction case.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Y7xSdVPS5vRu6wqf6XshRq

warpPlayer(world, user, owner) has two teleport paths: the normal one,
used when the spot in front of the sign is safe, fires WarpInitiateEvent,
respects vanished players, and tells the sign owner that someone warped
to them; and a fallback, used when no safe spot in front exists, which
teleported the visitor directly onto the sign's own block and did none of
that. Owners silently missed warp visits whenever the fallback ran.

The fallback is common on cramped islands — a ChunkBlock island starts as
a single chunk, so warp signs often sit at the platform edge with void in
front, which fails isSafeLocation and always takes the silent path. That
is how this surfaced: owners got warp messages in AOneBlock but never in
ChunkBlock.

The fallback now routes through the same warpPlayer completion path as a
normal warp, so the event, the vanish check, the sounds, and the owner
notification behave identically wherever the visitor lands. The sign's
facing is used for the arrival yaw, matching normal warps.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Y7xSdVPS5vRu6wqf6XshRq
@sonarqubecloud

Copy link
Copy Markdown

@tastybento
tastybento merged commit dbfc4f4 into develop Jul 29, 2026
3 checks passed
@tastybento
tastybento deleted the fix/notify-owner-on-fallback-warp branch July 29, 2026 23:57
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