Parkour

Parkour

570k Downloads

PlayerQuitEvent error in Paper 1.20.1

Leomelonseeds opened this issue ยท 3 comments

commented

Hey there, whenever a player leaves the server on the latest paper (1.20.1, git-Paper-63), the Player#isBanned method seems to bug out the method, leaving this annoying error message:

[00:53:22 ERROR]: Could not pass event PlayerQuitEvent to Parkour v7.2.0
java.lang.ClassCastException: class com.destroystokyo.paper.profile.CraftPlayerProfile cannot be cast to class org.bukkit.craftbukkit.v1_20_R1.profile.CraftPlayerProfile (com.destroystokyo.paper.profile.CraftPlayerProfile and org.bukkit.craftbukkit.v1_20_R1.profile.CraftPlayerProfile are in unnamed module of loader java.net.URLClassLoader @5c29bfd)
        at org.bukkit.craftbukkit.v1_20_R1.ban.CraftProfileBanList.isBanned(CraftProfileBanList.java:79) ~[paper-1.20.1.jar:git-Paper-63]
        at org.bukkit.craftbukkit.v1_20_R1.ban.CraftProfileBanList.isBanned(CraftProfileBanList.java:17) ~[paper-1.20.1.jar:git-Paper-63]
        at org.bukkit.craftbukkit.v1_20_R1.entity.CraftPlayer.isBanned(CraftPlayer.java:1631) ~[paper-1.20.1.jar:git-Paper-63]
        at io.github.a5h73y.parkour.listener.PlayerListener.onPlayerDisconnect(PlayerListener.java:254) ~[Parkour-7.2.0-RELEASE.jar:?]
        at com.destroystokyo.paper.event.executor.asm.generated.GeneratedEventExecutor320.execute(Unknown Source) ~[?:?]
        at org.bukkit.plugin.EventExecutor$2.execute(EventExecutor.java:77) ~[paper-api-1.20.1-R0.1-SNAPSHOT.jar:?]
        at co.aikar.timings.TimedEventExecutor.execute(TimedEventExecutor.java:81) ~[paper-api-1.20.1-R0.1-SNAPSHOT.jar:git-Paper-63]
        at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:70) ~[paper-api-1.20.1-R0.1-SNAPSHOT.jar:?]
        at io.papermc.paper.plugin.manager.PaperEventManager.callEvent(PaperEventManager.java:54) ~[paper-1.20.1.jar:git-Paper-63]
        at io.papermc.paper.plugin.manager.PaperPluginManagerImpl.callEvent(PaperPluginManagerImpl.java:126) ~[paper-1.20.1.jar:git-Paper-63]
        at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:615) ~[paper-api-1.20.1-R0.1-SNAPSHOT.jar:?]
        at net.minecraft.server.players.PlayerList.remove(PlayerList.java:599) ~[paper-1.20.1.jar:git-Paper-63]
        at net.minecraft.server.players.PlayerList.remove(PlayerList.java:584) ~[paper-1.20.1.jar:git-Paper-63]
        at net.minecraft.server.network.ServerGamePacketListenerImpl.onDisconnect(ServerGamePacketListenerImpl.java:2123) ~[?:?]
        at net.minecraft.server.network.ServerGamePacketListenerImpl.onDisconnect(ServerGamePacketListenerImpl.java:2102) ~[?:?]
        at net.minecraft.network.Connection.handleDisconnection(Connection.java:818) ~[?:?]
        at net.minecraft.network.Connection.tick(Connection.java:611) ~[?:?]
        at net.minecraft.server.network.ServerConnectionListener.tick(ServerConnectionListener.java:234) ~[?:?]
        at net.minecraft.server.MinecraftServer.tickChildren(MinecraftServer.java:1587) ~[paper-1.20.1.jar:git-Paper-63]
        at net.minecraft.server.dedicated.DedicatedServer.tickChildren(DedicatedServer.java:447) ~[paper-1.20.1.jar:git-Paper-63]
        at net.minecraft.server.MinecraftServer.tickServer(MinecraftServer.java:1394) ~[paper-1.20.1.jar:git-Paper-63]
        at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1171) ~[paper-1.20.1.jar:git-Paper-63]
        at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:318) ~[paper-1.20.1.jar:git-Paper-63]
        at java.lang.Thread.run(Thread.java:833) ~[?:?]

Any help would be appreciated, thanks in advance!

commented

I have found that this is a Paper problem, which has a fix in the works:
PaperMC/Paper#9455

As there is not much I can do about this, I will close the ticket unless I need to update the code in the future.

commented

@SirCraftypants if you don't mind the option to clear player's parkour data when they get banned, I've compiled a jar that doesn't have the bugged line:
Parkour-7.2.0.zip

commented

yes, i just got the same error with latest version on paper 1.20.1