Skip to content

Possible bug in teleportAsync #26

Description

@cavallium

Stack trace

java.lang.IllegalStateException: Player is already removed from player chunk loader
      at io.papermc.paper.chunk.system.RegionizedPlayerChunkLoader.removePlayer(RegionizedPlayerChunkLoader.java:158) ~[folia-1.19.4.jar:git-Folia-"7072994"]
      at net.minecraft.server.level.ChunkMap.removePlayerFromDistanceMaps(ChunkMap.java:213) ~[folia-1.19.4.jar:git-Folia-"7072994"]
      at net.minecraft.server.level.ChunkMap.updatePlayerStatus(ChunkMap.java:1016) ~[folia-1.19.4.jar:git-Folia-"7072994"]
      at net.minecraft.server.level.ChunkMap.removeEntity(ChunkMap.java:1103) ~[folia-1.19.4.jar:git-Folia-"7072994"]
      at net.minecraft.server.level.ServerChunkCache.removeEntity(ServerChunkCache.java:871) ~[folia-1.19.4.jar:git-Folia-"7072994"]
      at net.minecraft.server.level.ServerLevel$EntityCallbacks.onTrackingEnd(ServerLevel.java:2837) ~[folia-1.19.4.jar:git-Folia-"7072994"]
      at net.minecraft.server.level.ServerLevel$EntityCallbacks.onTrackingEnd(ServerLevel.java:2715) ~[folia-1.19.4.jar:git-Folia-"7072994"]
      at io.papermc.paper.chunk.system.entity.EntityLookup.entityStatusChange(EntityLookup.java:288) ~[folia-1.19.4.jar:git-Folia-"7072994"]
      at io.papermc.paper.chunk.system.entity.EntityLookup$EntityCallback.onRemove(EntityLookup.java:848) ~[folia-1.19.4.jar:git-Folia-"7072994"]
      at net.minecraft.world.entity.Entity.setRemoved(Entity.java:5328) ~[folia-1.19.4.jar:git-Folia-"7072994"]
      at net.minecraft.world.entity.Entity.remove(Entity.java:693) ~[folia-1.19.4.jar:git-Folia-"7072994"]
      at net.minecraft.world.entity.LivingEntity.remove(LivingEntity.java:745) ~[folia-1.19.4.jar:git-Folia-"7072994"]
      at net.minecraft.world.entity.player.Player.remove(Player.java:1496) ~[folia-1.19.4.jar:git-Folia-"7072994"]
      at net.minecraft.server.level.ServerLevel.removePlayerImmediately(ServerLevel.java:1701) ~[folia-1.19.4.jar:git-Folia-"7072994"]
      at net.minecraft.server.level.ServerPlayer.transformForAsyncTeleport(ServerPlayer.java:1396) ~[folia-1.19.4.jar:git-Folia-"7072994"]
      at net.minecraft.server.level.ServerPlayer.transformForAsyncTeleport(ServerPlayer.java:188) ~[folia-1.19.4.jar:git-Folia-"7072994"]
      at net.minecraft.world.entity.Entity.teleportAsync(Entity.java:3780) ~[folia-1.19.4.jar:git-Folia-"7072994"]
      at org.bukkit.craftbukkit.v1_19_R3.entity.CraftEntity.lambda$teleportAsync$1(CraftEntity.java:1336) ~[folia-1.19.4.jar:git-Folia-"7072994"]
      at org.bukkit.craftbukkit.v1_19_R3.entity.CraftEntity.teleportAsync(CraftEntity.java:1351) ~[folia-1.19.4.jar:git-Folia-"7072994"]
      at org.bukkit.entity.Entity.teleportAsync(Entity.java:199) ~[folia-api-1.19.4-R0.1-SNAPSHOT.jar:?]
      ...
      ...
      ...
      at fr.xephi.authme.listener.PlayerListener.onPlayerJoin(PlayerListener.java:184) ~[AuthMe-5.6.0-SNAPSHOT.jar:?]
      at com.destroystokyo.paper.event.executor.asm.generated.GeneratedEventExecutor51.execute(Unknown Source) ~[?:?]
      at org.bukkit.plugin.EventExecutor$2.execute(EventExecutor.java:77) ~[folia-api-1.19.4-R0.1-SNAPSHOT.jar:?]
      at co.aikar.timings.TimedEventExecutor.execute(TimedEventExecutor.java:77) ~[folia-api-1.19.4-R0.1-SNAPSHOT.jar:git-Folia-"7072994"]
      at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:70) ~[folia-api-1.19.4-R0.1-SNAPSHOT.jar:?]
      at io.papermc.paper.plugin.manager.PaperEventManager.callEvent(PaperEventManager.java:54) ~[folia-1.19.4.jar:git-Folia-"7072994"]
      at io.papermc.paper.plugin.manager.PaperPluginManagerImpl.callEvent(PaperPluginManagerImpl.java:126) ~[folia-1.19.4.jar:git-Folia-"7072994"]
      at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:615) ~[folia-api-1.19.4-R0.1-SNAPSHOT.jar:?]
      at net.minecraft.server.players.PlayerList.placeNewPlayer(PlayerList.java:404) ~[folia-1.19.4.jar:git-Folia-"7072994"]
      at net.minecraft.server.network.ServerLoginPacketListenerImpl.lambda$handleAcceptedLogin$1(ServerLoginPacketListenerImpl.java:204) ~[folia-1.19.4.jar:git-Folia-"7072994"]
      at io.papermc.paper.threadedregions.RegionizedTaskQueue$PrioritisedQueue$ChunkBasedPriorityTask.executeInternal(RegionizedTaskQueue.java:489) ~[folia-1.19.4.jar:git-Folia-"7072994"]
      at io.papermc.paper.threadedregions.RegionizedTaskQueue$PrioritisedQueue.executeTask(RegionizedTaskQueue.java:419) ~[folia-1.19.4.jar:git-Folia-"7072994"]
      at io.papermc.paper.threadedregions.RegionizedTaskQueue$RegionTaskQueueData.drainTasks(RegionizedTaskQueue.java:248) ~[folia-1.19.4.jar:git-Folia-"7072994"]
      at net.minecraft.server.MinecraftServer.tickServer(MinecraftServer.java:1523) ~[folia-1.19.4.jar:git-Folia-"7072994"]
      at io.papermc.paper.threadedregions.TickRegions$ConcreteRegionTickHandle.tickRegion(TickRegions.java:316) ~[folia-1.19.4.jar:git-Folia-"7072994"]
      at io.papermc.paper.threadedregions.TickRegionScheduler$RegionScheduleHandle.runTick(TickRegionScheduler.java:383) ~[folia-1.19.4.jar:git-Folia-"7072994"]
      at ca.spottedleaf.concurrentutil.scheduler.SchedulerThreadPool$TickThreadRunner.run(SchedulerThreadPool.java:525) ~[folia-1.19.4.jar:git-Folia-"7072994"]
      at java.lang.Thread.run(Thread.java:1589) ~[?:?]

Plugin and Datapack List

AuthMeReloaded

Actions to reproduce (if known)

  1. Call Bukkit.isOwnedByCurrentRegion(entity)
  2. If it returns true, call .teleportAsync(entity, loc)

Folia version

Latest commit, 7072994

Other

teleportAsync() documentation tells that it should return a future with the result of the teleport, it shouldn't throw an exception if the teleport is not possible.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions