Repository navigation
Conversation
AsyncTeleport#teleportPlayer and #warp(otherUser, ...) called teleport(otherUser, ...), which fires TeleportWarmupEvent with teleporter == teleportee, so listeners could not tell who ran /tphere, /tpahere, /tpaccept or /warp <warp> <player>. Route them through teleportOther(teleportOwner, otherUser, ...) like back() already does, and complete the future with false when teleportOther stops early (event cancelled or cooldown), matching teleport(). Follow-up to EssentialsX#4673 / EssentialsX#4913.
3 tasks
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.
Information
This PR is a follow-up to #4673 (fixed by #4913). The same bug is still present for
/tphere, so it fixes the remaining cases from #4673.Details
Proposed fix:
#4913 fixed
AsyncTeleport#teleportOther, but onlyback()calls it./tphereusesteleportPlayer(otherUser, ...), which still callsteleport(otherUser, ...)and firesTeleportWarmupEventwithteleporter == teleportee. So the reproduction from #4673 still prints the same player twice.Affected paths (all called on the initiator's
AsyncTeleport, soteleportOwneris the initiator):teleportPlayer(IUser, Player, ...):/tphere,/tpacceptfor a/tparequestteleportPlayer(IUser, Location, ...):/tpacceptfor a/tpahererequestwarp(IUser, ...):/warp <warp> <player>Changes:
teleportOther(teleportOwner, otherUser, ...), likeback()already does.teleportOthernow completes the future withfalsewhen it returns early (warmup event cancelled or cooldown), matchingteleport(). Without this, cancellingTeleportWarmupEventfor/tpherewould leave the future incomplete.Charging, cooldowns and
essentials.teleport.timer.bypassare unchanged:teleportOtherchecks the same things.Environments tested:
OS: Windows
Java version: OpenJDK 25.0.5 (build), tests via
./gradlew :EssentialsX:build(checkstyle and unit tests pass)Not yet tested on a live server separately from the build; happy to add server test results if needed.
Demonstration:
Listener from #4673:
Aruns/tphere B:Teleporter: B,Teleportee: BTeleporter: A,Teleportee: B