FastAsyncWorldEdit

FastAsyncWorldEdit

152k Downloads

Citizens: Could not pass event PlayerGameModeChangeEvent to FastAsyncWorldEdit

vyvin opened this issue ยท 5 comments

commented

Server Implementation

Paper

Server Version

1.19.3

Describe the bug

[21:04:45 ERROR]: Could not pass event PlayerGameModeChangeEvent to FastAsyncWorldEdit v2.5.3-SNAPSHOT-356;783dc35
me.lucko.luckperms.bukkit.vault.ServerThreadLookupException: A Vault API request has been made on the main server thread that LuckPerms cannot safely respond to.
This is NOT a bug - please do not report it to LuckPerms.
Instead, please carefully read the information given below.

LuckPerms cannot respond to the request because to do so:
- it needs to lookup user data for 'e721632a-113d-403d-ad12-00e145cb7c83' (an offline player) from the database

Performing this lookup on the main server thread would cause your server to lag.
There are two solutions to this problem:
  a) Ask the author of the plugin making the request to perform Vault calls for
     offline players "asynchronously" (using the scheduler). Additionally, prefer
     using the methods that accept 'Player' or 'OfflinePlayer' instead of usernames.
     You should be able to identify the plugin making the request in the trace below.
  b) As a server admin, you can disable this exception by setting 'vault-unsafe-lookups'
     to true in the LuckPerms configuration file. However, please use this only as
     a last resort.
        at me.lucko.luckperms.bukkit.vault.LuckPermsVaultPermission.lookupUser(LuckPermsVaultPermission.java:156) ~[?:?]
        at me.lucko.luckperms.bukkit.vault.LuckPermsVaultPermission.userHasPermission(LuckPermsVaultPermission.java:175) ~[?:?]
        at me.lucko.luckperms.bukkit.vault.AbstractVaultPermission.playerHas(AbstractVaultPermission.java:151) ~[?:?]
        at com.sk89q.wepif.VaultResolver.hasPermission(VaultResolver.java:102) ~[FastAsyncWorldEdit-Bukkit-2.5.3-SNAPSHOT-356.jar:?]
        at com.sk89q.wepif.PermissionsResolverManager.hasPermission(PermissionsResolverManager.java:171) ~[FastAsyncWorldEdit-Bukkit-2.5.3-SNAPSHOT-356.jar:?]
        at com.sk89q.worldedit.bukkit.BukkitPlayer.hasPermission(BukkitPlayer.java:276) ~[FastAsyncWorldEdit-Bukkit-2.5.3-SNAPSHOT-356.jar:?]
        at com.sk89q.worldedit.command.tool.NavigationWand.canUse(NavigationWand.java:74) ~[FastAsyncWorldEdit-Bukkit-2.5.3-SNAPSHOT-356.jar:?]
        at com.sk89q.worldedit.LocalSession.loadDefaults(LocalSession.java:1181) ~[FastAsyncWorldEdit-Bukkit-2.5.3-SNAPSHOT-356.jar:?]
        at com.sk89q.worldedit.bukkit.WorldEditListener.onGamemode(WorldEditListener.java:80) ~[FastAsyncWorldEdit-Bukkit-2.5.3-SNAPSHOT-356.jar:?]
        at com.destroystokyo.paper.event.executor.asm.generated.GeneratedEventExecutor37.execute(Unknown Source) ~[?:?]
        at org.bukkit.plugin.EventExecutor$2.execute(EventExecutor.java:77) ~[pufferfish-api-1.19.3-R0.1-SNAPSHOT.jar:?]
        at co.aikar.timings.TimedEventExecutor.execute(TimedEventExecutor.java:76) ~[pufferfish-api-1.19.3-R0.1-SNAPSHOT.jar:git-Pufferfish-58]
        at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:70) ~[pufferfish-api-1.19.3-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:674) ~[pufferfish-api-1.19.3-R0.1-SNAPSHOT.jar:?]
        at net.minecraft.server.level.ServerPlayerGameMode.changeGameModeForPlayer(ServerPlayerGameMode.java:89) ~[?:?]
        at net.minecraft.server.level.ServerPlayer.setGameMode(ServerPlayer.java:1880) ~[?:?]
        at org.bukkit.craftbukkit.v1_19_R2.entity.CraftPlayer.setGameMode(CraftPlayer.java:1593) ~[pufferfish-1.19.3.jar:git-Pufferfish-58]
        at net.citizensnpcs.trait.GameModeTrait.run(GameModeTrait.java:31) ~[Citizens-2.0.30-b2931.jar:?]
        at net.citizensnpcs.api.npc.AbstractNPC.update(AbstractNPC.java:572) ~[Citizens-2.0.30-b2931.jar:?]
        at net.citizensnpcs.npc.CitizensNPC.update(CitizensNPC.java:455) ~[Citizens-2.0.30-b2931.jar:?]
        at net.citizensnpcs.nms.v1_19_R2.entity.EntityHumanNPC.l(EntityHumanNPC.java:498) ~[Citizens-2.0.30-b2931.jar:?]
        at net.minecraft.server.level.ServerLevel.tickNonPassenger(ServerLevel.java:1227) ~[?:?]
        at net.minecraft.server.level.ServerLevel.lambda$tick$6(ServerLevel.java:734) ~[?:?]
        at net.minecraft.world.level.entity.EntityTickList.forEach(EntityTickList.java:42) ~[pufferfish-1.19.3.jar:git-Pufferfish-58]
        at net.minecraft.server.level.ServerLevel.tick(ServerLevel.java:711) ~[?:?]
        at net.minecraft.server.MinecraftServer.tickChildren(MinecraftServer.java:1537) ~[pufferfish-1.19.3.jar:git-Pufferfish-58]
        at net.minecraft.server.dedicated.DedicatedServer.tickChildren(DedicatedServer.java:443) ~[pufferfish-1.19.3.jar:git-Pufferfish-58]
        at net.minecraft.server.MinecraftServer.tickServer(MinecraftServer.java:1399) ~[pufferfish-1.19.3.jar:git-Pufferfish-58]
        at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1175) ~[pufferfish-1.19.3.jar:git-Pufferfish-58]
        at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:318) ~[pufferfish-1.19.3.jar:git-Pufferfish-58]
        at java.lang.Thread.run(Thread.java:833) ~[?:?]

To Reproduce

  1. Have FAWE, Citizens, Luckperms plugins
  2. Start server with some citizen npcs configured
  3. Get error in console

Expected behaviour

FAWE should not look for permissions of NPC or at the very least not look for permissions on the main server thread

Screenshots / Videos

No response

Error log (if applicable)

No response

Fawe Debugpaste

https://athion.net/ISPaster/paste/view/b47652748d064653a87d7943632285a3

Fawe Version

FastAsyncWorldEdit version 2.5.3-SNAPSHOT-356;783dc35

Checklist

Anything else?

Pretty sure it's FAWE trying to find permissions on Citizens plugin NPCs as the UUID referenced can't be found in a lookup on https://mcuuid.net/?q=e721632a-113d-403d-ad12-00e145cb7c83

commented

Citizens.

commented

Citizens.

Is the technical dept on citizens? If yes, this could be closed and the developers of citizens can be informed.

commented

We possibly forgot to check if the Player (Entity) is an NPC in the first place. We do it at some places, but possibly forgot it there.
Should be an easy fix by checking if the Entity has the NPC-metadata attribute attached Metadatable#hasMetadata

commented

I tested it with Paper 1.19.4, Vault (the first one you get through google https://dev.bukkit.org/projects/vault) and FastAsyncWorldEdit-408 and also Luckperms 5.4.62. I created two npcs and restarted the server, nothing happened through the console.

@vyvin can you replicate your bug on a paper server or pufferfish server with latest versions of these plugins and only them? Your debugpaste shows > 100 Plugins that could influence this behaviour.

commented

There was no answer for almost 2 weeks and I was not able to reproduce this issue. If someone has this problem, feel free to open an issue!