Repository navigation
Conversation
…e, /tpall Add IAsyncTeleport#now overloads taking the teleporter (default methods, so the API stays compatible), pass the command sender from /tp <a> <b>, /tp <player> <x y z>, /tpo <a> <b>, /tpohere and /tpall, and report the warmup owner as teleporter when a timed teleport fires.
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
There is no separate feature request; this is related to #4673 and #6651.
TeleportEvent#getTeleporter()is documented as "the user that initiated the teleportation", but for teleports that go throughIAsyncTeleport#nowit is always the teleportee.Details
Proposed feature:
/tpo <a> <b>,/tpohere,/tp <a> <b>,/tp <player> <x> <y> <z>and/tpallcalltarget.getAsyncTeleport().now(...)on the teleported player.AsyncTeleporthas no way to know who ran the command, soPreTeleportEvent#getTeleporter()reports the teleportee. A listener cannot tell which player to inform or check permissions for.Changes:
IAsyncTeleport: newnow(IUser teleporter, Location, ...)andnow(IUser teleporter, Player, ...)overloads. They aredefaultmethods that delegate to the existing ones, so other implementations do not break.PreTeleportEvent: new constructor with an explicit teleporter (same asTeleportWarmupEventalready has).AsyncTeleport: the existingnow(...)methods call the new ones withnull;nowAsyncgets an overload with the teleporter. When the teleporter isnull, the teleportee is reported, as before.AsyncTimedTeleport: when a warmup finishes, the warmup owner is reported as the teleporter (this matters for/tphereonce Fix TeleportWarmupEvent teleporter for /tphere, /tpaccept and /warp <player> #6651 is merged)./tp,/tpo,/tpohere,/tpallpass the command sender when it is a player. Console usage still reports the teleportee.No behaviour changes besides the value of
getTeleporter().Environments tested:
OS: Windows
Java version: OpenJDK 25.0.5 (build),
./gradlew :EssentialsX:buildpasses (checkstyle and unit tests)Demonstration:
Example use: a plugin that blocks teleports into a protected world and tells the player who ran the command.
Aruns/tpohere B:getTeleporter()=BgetTeleporter()=A