Repository navigation
fix(folia): use the teleport adapter in /authme spawn and firstspawn - #3163
Merged
Xephi merged 1 commit intoOct 11, 2026
Merged
Conversation
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
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.
/authme spawnand/authme firstspawncallPlayer#teleportdirectly. On Folia (and Canvas, as in #3161) that throwsUnsupportedOperationException: 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
TeleportAdapterand callteleportPlayer, likePlayerListenerandTeleportationServicedo. The Paper and Folia adapters useteleportAsync; the Spigot adapters still callteleport, so nothing changes there.Testing:
SpawnCommandTestandFirstSpawnCommandTestnow verify the call on the adapter. With only the tests changed they fail on master.mvn -V -B clean packageon JDK 21 (all modules) and JDK 17: build passes.AuthMe-*-Folia.jarand 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 setfirstspawnand/authme firstspawn, and for a spawn set in the nether while the player is in the overworld.Not tested: Canvas itself, and a second world created by a multi-world plugin (I used the nether).
Fixes #3161