Skip to content

Safe End arrival when the obsidian platform is off - #3101

Merged
tastybento merged 1 commit into
developfrom
fix/end-portal-safe-arrival
Oct 17, 2026
Merged

tastybento merged 1 commit into
developfrom
fix/end-portal-safe-arrival

Conversation

@tastybento

Copy link
Copy Markdown
Member

Problem

With create-obsidian-platform: false, going through an End portal could drop the player into the void. portalProcess never cancelled the portal event on that path, so the server teleported the player in the same tick to the exact destination, whether or not there was a floor. The safe spot teleport scheduled for the next tick then found the player already in the End and did nothing.

Changes

  • Unsafe End arrivals are cancelled. A new method, AbstractTeleportListener.isUnsafeEndArrival(), returns true when the trip arrives in the End with no platform and isSafeLocation() finds no floor. The player and entity listeners then cancel the event, so the existing ClosestSafeSpotTeleport path runs: nearest safe spot, then the highest block, then a pod. Safe arrivals still teleport instantly, and trips with the platform on are unchanged.
  • Repeat portal events are cancelled. After the cancel, the player is still standing in the portal and the server keeps firing portal events. The inTeleport early return let those through uncancelled, so the server would send the player to the vanilla End spawn. A new method, isPendingEndTeleport(), cancels these repeats for End trips with no platform.
  • The pod teleport lands on the block centre. makeAndTeleport in both ClosestSafeSpotTeleport and SafeSpotTeleport teleported to the requested location + 0.5. When that location was already off-centre, for example x = -0.5, the player landed on the block edge at x = 0.0 and could fall. It now teleports to the block's centre, keeping yaw and pitch.

Testing

  • New tests in PlayerTeleportListenerTest: an unsafe arrival is cancelled; a safe arrival is not; a repeat event is cancelled with no platform and left alone with the platform on.
  • New test in ClosestSafeSpotTeleportTest: a pod at an off-centre location teleports to the block centre.
  • ./gradlew clean build passes.
  • Tested in-game on 26.3: an End portal trip with the platform off now lands in a pod instead of the void. The block-centre fix has not been retested in-game yet.

🤖 Generated with Claude Code

With create-obsidian-platform: false the portal event was never
cancelled, so the server teleported the player in the same tick to a
spot that could have no floor, and the scheduled safe spot teleport
then found the player already in the End and did nothing. Cancel the
event when the End arrival is unsafe so the safe spot teleport runs,
and cancel repeat portal events while that teleport is pending so the
server cannot send the player to the vanilla End spawn instead.
Applies to players and entities.

Also teleport to the centre of the block when a safe spot pod is
built. The target was the requested location plus 0.5, which lands on
a block edge when the location is already off-centre.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@sonarqubecloud

Copy link
Copy Markdown

@tastybento
tastybento merged commit d7c1631 into develop Oct 17, 2026
3 checks passed
@tastybento
tastybento deleted the fix/end-portal-safe-arrival branch October 17, 2026 15:54
@tastybento tastybento mentioned this pull request Oct 17, 2026
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