Skip to content

fix(folia): use the teleport adapter in /authme spawn and firstspawn - #3163

Merged
Xephi merged 1 commit into
AuthMe:masterfrom
rishabhvenu:fix/spawn-command-teleport-adapter
Oct 11, 2026
Merged

Xephi merged 1 commit into
AuthMe:masterfrom
rishabhvenu:fix/spawn-command-teleport-adapter

Conversation

@rishabhvenu

Copy link
Copy Markdown
Contributor

/authme spawn and /authme firstspawn call Player#teleport directly. On Folia (and Canvas, as in #3161) that throws UnsupportedOperationException: Must use teleportAsync while in region threading, so both commands fail with "An unexpected error occurred trying to execute that command".

These were the only two teleports outside the platform adapter. Both commands now inject TeleportAdapter and call teleportPlayer, like PlayerListener and TeleportationService do. The Paper and Folia adapters use teleportAsync; the Spigot adapters still call teleport, so nothing changes there.

Testing:

  • SpawnCommandTest and FirstSpawnCommandTest now verify the call on the adapter. With only the tests changed they fail on master.
  • mvn -V -B clean package on JDK 21 (all modules) and JDK 17: build passes.
  • Folia 1.21.11 (build 14) with AuthMe-*-Folia.jar and an op bot: /authme setspawn, move away, /authme spawn. Master logs the exception from the issue and the player does not move; with the change the player ends up at the spawn. Same for /authme setfirstspawn and /authme firstspawn, and for a spawn set in the nether while the player is in the overworld.
  • Paper 1.21.11 with the Paper jar and with the Spigot-1.21 jar: the same steps teleport correctly, as before.

Not tested: Canvas itself, and a second world created by a multi-world plugin (I used the nether).

Fixes #3161

SpawnCommand and FirstSpawnCommand called Player#teleport directly. Folia
rejects that with "Must use teleportAsync while in region threading", so
both commands failed with an unexpected error there.

Go through TeleportAdapter#teleportPlayer as the other teleports do. The
Paper and Folia adapters use teleportAsync, the Spigot ones keep the
synchronous teleport.

Fixes AuthMe#3161
@Xephi
Xephi merged commit 2a05f5f into AuthMe:master Oct 11, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

在 Canvas/Folia 环境下 SpawnCommand 使用了同步 teleport() 导致崩溃

2 participants