YouHaveTrouble / CommandWhitelist

You decide what commands players can use or tab complete on your server!
GNU General Public License v2.0
207 stars 22 forks source link

Add Paper's AsyncPlayerSendCommandsEvent listener #47

Closed 4drian3d closed 2 years ago

4drian3d commented 2 years ago

Added a command hint control for Paper's AsyncPlayerSendCommandsEvent https://github.com/PaperMC/Paper/blob/master/Paper-MojangAPI/src/main/java/com/destroystokyo/paper/event/brigadier/AsyncPlayerSendCommandsEvent.java

I know that the event is deprecated because it is a Draft API, however, I have tested the event on my server with my own plugin for quite a while and it seems to work correctly

YouHaveTrouble commented 2 years ago

Is there really that much difference between current method and the new one? I'm pretty sure both events are fired and processed either way, so I'm not sure if this would help at all.

4drian3d commented 2 years ago

In itself, there is not much difference. Although this event is executed before the classic bukkit event (which may solve some conflict with some plugin that wants to modify the commands in the same event maybe?), besides it uses brigadier.

YouHaveTrouble commented 2 years ago

Only conflicts that can occur are plugins adding completions in the event on LOW and LOWEST prio afaik. Sadly nothing can be done about that. I don't really see the reason to complicate things. Will leave this open for a while, maybe someone will point out something I don't know.

4drian3d commented 2 years ago

I would have liked this pull request to be integrated, but it's not that fundamental and doesn't represent a big performance improvement, so I'm closing it for now