Skip to content

Fix TeleportWarmupEvent teleporter for /tphere, /tpaccept and /warp <player> - #6651

Open
1wairesd wants to merge 1 commit into
EssentialsX:2.xfrom
1wairesd:fix/tphere-teleporter
Open

1wairesd wants to merge 1 commit into
EssentialsX:2.xfrom
1wairesd:fix/tphere-teleporter

Conversation

@1wairesd

@1wairesd 1wairesd commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

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 only back() calls it. /tphere uses teleportPlayer(otherUser, ...), which still calls teleport(otherUser, ...) and fires TeleportWarmupEvent with teleporter == teleportee. So the reproduction from #4673 still prints the same player twice.

Affected paths (all called on the initiator's AsyncTeleport, so teleportOwner is the initiator):

  • teleportPlayer(IUser, Player, ...): /tphere, /tpaccept for a /tpa request
  • teleportPlayer(IUser, Location, ...): /tpaccept for a /tpahere request
  • warp(IUser, ...): /warp <warp> <player>

Changes:

  • These three methods now call teleportOther(teleportOwner, otherUser, ...), like back() already does.
  • teleportOther now completes the future with false when it returns early (warmup event cancelled or cooldown), matching teleport(). Without this, cancelling TeleportWarmupEvent for /tphere would leave the future incomplete.

Charging, cooldowns and essentials.teleport.timer.bypass are unchanged: teleportOther checks the same things.

Environments tested:

OS: Windows

Java version: OpenJDK 25.0.5 (build), tests via ./gradlew :EssentialsX:build (checkstyle and unit tests pass)

  • Most recent Paper version (XX.YY.Z, git-Paper-BUILD)
  • CraftBukkit/Spigot/Paper 1.12.2
  • CraftBukkit 1.8.8

Not yet tested on a live server separately from the build; happy to add server test results if needed.

Demonstration:

Listener from #4673:

@EventHandler
public void onWarmup(TeleportWarmupEvent event) {
    System.out.println("Teleporter: " + event.getTeleporter().getName());
    System.out.println("Teleportee: " + event.getTeleportee().getName());
}

A runs /tphere B:

  • before: Teleporter: B, Teleportee: B
  • after: Teleporter: A, Teleportee: B

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.
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