Paper teleportAsync blocked during PlayerSpawnLocationEvent or PlayerJoinEvent
What behaviour is observed?
The following code is obstructed by a loaded AuthMeReloaded: https://gist.github.com/MithrandirCraft/108cfd2a34db7cfa54c83afa1bc72922 In essence, attempting to execute teleport, or teleportAsync during PlayerSpawnLocationEvent or PlayerJoinEvent.
In line 28, player.teleportAsync() will never complete. I am naively asuming this is happening because AuthMe is forcing it's own teleportation based on logout coordinates.
The event will also not prioritize my own teleportAsync if I set EventHandler(priority = EventPriority.HIGHEST)
I also tried teleporting the player with a 5 tick delay after join, with no luck. I could try higher, but really it sonds like a bad solution so I dropped that option.
This does not happen without a loaded instance of AuthMeReloaded on the same server.
Expected behaviour
I don't know really. I'd say this is kinda normal considering how AuthMe handles login coordinates. I'd just like to know what the workaround is for this.
My system is supposed to check if the player's spawn coordinates on login are within an area (line 24 of my code, returning a Location and not null), if so, the player is sent to spawn, else the player appears in it's last logout coordinates.
To Reproduce
- Have AuthMeReloaded loaded on a blank paper server.
- Have a separate plugin with player.teleportAsync on a separate jar for PlayerSpawnLocationEvent or PlayerJoinEvent.
- Join the server and notice the teleport will not occur.
Plugin list
Plugins (54): 40ServidoresMC, AdvancedPortals, AuthMe, BanFromClaim, BetterChair, BetterRTP, BottledExp, BungeeTabListPlus, ChatControlRed, ClearLag, CMILib, CoreProtect, CrazyCrates, CustomJukebox, DisableSuffocation, DownloadResourcePack, ElytraBalance, EnjinMinecraftPlugin, Essentials, EssentialsSpawn, FastAsyncVoxelSniper, FastAsyncWorldEdit (WorldEdit), FastLogin, GriefDefender, Guilds, HolographicDisplays, HolographicScoreboard*, HopeCommander-Spigot*, JukeboxRegion, LibsDisguises, LuckPerms, MarriageMaster, MiniaturePets, MythicMobs, NameMCVotifierHook, NerfVillages, PlaceholderAPI, PlayerHeads, PlayerWarps, PremiumVanish, ProtocolLib, Shopkeepers, SkinsRestorer, Spartan, Spawner, SSX-Connector, StatsPvP*, Storage, TradeSystem, Vault, ViewDistanceTweaks, Votifier, VotingPlugin, WorldGuard
Server Implementation
BungeeCord
Database Implementation
MySQL
AuthMe Version
5.6.0-SNAPSHOT-b2530
Error log (if applicable)
No response
Configuration
https://gist.github.com/MithrandirCraft/e19e818e7f3abf30a2cfc4a8359bd52d
In the config, try changing noTeleport setting and you still have teleportUnAuthedToSpawn enabled...
noTeleport this does indeed fix the issue. But it will make teleportUnAuthedToSpawn not work, of course you could argue the whole event gets overriden by the unauthed to spawn behaviour.
Maybe the best option would be hooking up to the AuthMe API?