Repository navigation
Safe End arrival when the obsidian platform is off - #3101
Merged
Merged
Conversation
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>
|
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Problem
With
create-obsidian-platform: false, going through an End portal could drop the player into the void.portalProcessnever 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
AbstractTeleportListener.isUnsafeEndArrival(), returns true when the trip arrives in the End with no platform andisSafeLocation()finds no floor. The player and entity listeners then cancel the event, so the existingClosestSafeSpotTeleportpath runs: nearest safe spot, then the highest block, then a pod. Safe arrivals still teleport instantly, and trips with the platform on are unchanged.inTeleportearly 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.makeAndTeleportin bothClosestSafeSpotTeleportandSafeSpotTeleportteleported 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
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.ClosestSafeSpotTeleportTest: a pod at an off-centre location teleports to the block centre../gradlew clean buildpasses.🤖 Generated with Claude Code