-
-
Notifications
You must be signed in to change notification settings - Fork 2
Description
a recent Paper change means that duplicate(?) events for PlayerCommandSendEvent are now received, some of which are Async, others Sync.
PR #15 (release 0.20.5) workarounds this issue to only to avoid errors, it does not add support for async command list events - the impacts are not yet well known.
Since this plugin need to checks users permissions (sync required) and it also needs to fillter the current commands before returing (current async thread), there may not be a good fix if async command-list events become the standard.
The plugin cannot defer to a sync thread to do this task because the only chance to modify the list is in the current event call. The event cannot be forced to wait for the sync operation to complete either (really bad idea) or the server will deadlock. The only way I see that you could fix this is if you pre-fetched all of the permissions and config values prior to the commands event - but since these occur within the same tick as login, this may prove difficult.
Relevant server log
[08.12 17:08:55] [Server] [WARN] Exception in thread "ForkJoinPool.commonPool-worker-12" java.lang.NoClassDefFoundError: Could not initialize class com.destroystokyo.paper.event.brigadier.AsyncPlayerSendCommandsEvent
[08.12 17:08:55] [Server] [WARN] at net.minecraft.server.v1_16_R3.CommandDispatcher.sendAsync(CommandDispatcher.java:273)
[08.12 17:08:55] [Server] [WARN] at net.minecraft.server.v1_16_R3.CommandDispatcher.lambda$a$4(CommandDispatcher.java:249)
[08.12 17:08:55] [Server] [WARN] at java.util.concurrent.ForkJoinTask$RunnableExecuteAction.exec(ForkJoinTask.java:1402)
[08.12 17:08:55] [Server] [WARN] at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
[08.12 17:08:55] [Server] [WARN] at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1067)
[08.12 17:08:55] [Server] [WARN] at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1703)
[08.12 17:08:55] [Server] [WARN] at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:172)
Paper-1.16.4 build 318