You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
BlackWidow's command blocking module requires a listener to review and manage command suggestions that the server/proxy implementation wants to send to players.
The Bukkit API has PlayerCommandSendEvent, which works great, with one major caveat: the server calls it synchronously.
On PaperMC server implementations, we can instead listen to AsyncPlayerSendCommandsEvent.html, which is (usually - but not guaranteed to.. anyways,) be called asynchronously by the server.
Challenges
This event seems to not be well-known and thus isn't utilized often in plugins. With rather limited documentation on the event and (very) poor knowledge with Brigadier, I'm ill-equipped as of posting this issue to tackle this.
To expand on the Brigadier challenge: the Paper event presents a Brigadier command node - a more contemporary API choice, which is great, but requires a new style of parser. Furthermore, instead of rather simple lists of arguments suggestions, we get a root command tree which needs to be managed entirely differently than just simply removing offending strings from a mutable list (Bukkit API / legacy approach).
That being said, I think it may be worth going through the server software source code and checking how PlayerCommandSendEvent adapts Brigadier commands into standard Bukkit command strings. Or, there is a better way to do it, research to be done...
Goals
Detect when PaperMC (or derivative) server software implementation is running.
To be completed together:
Disable listener PlayerCommandSendListener when PaperMC is used.
Implement AsyncPlayerSendCommandsListener.
Enable AsyncPlayerSendCommandsListener when PaperMC is used.
Test it works.
Detecting suggestions (can see them coming in)
Managing suggestions (removing those which are blocked for the player)
Listener handles the event asynchronously only
Not being accessed on SpigotMC servers (i.e., no Paper API present; NOT PaperMC or derivatives).
Other
I plan to work on this. If you have worked with this event before, please feel free to let me know below, I would love some assistance :)
The text was updated successfully, but these errors were encountered:
Context
BlackWidow's command blocking module requires a listener to review and manage command suggestions that the server/proxy implementation wants to send to players.
The Bukkit API has
PlayerCommandSendEvent
, which works great, with one major caveat: the server calls it synchronously.On PaperMC server implementations, we can instead listen to
AsyncPlayerSendCommandsEvent.html
, which is (usually - but not guaranteed to.. anyways,) be called asynchronously by the server.Challenges
This event seems to not be well-known and thus isn't utilized often in plugins. With rather limited documentation on the event and (very) poor knowledge with Brigadier, I'm ill-equipped as of posting this issue to tackle this.
To expand on the Brigadier challenge: the Paper event presents a Brigadier command node - a more contemporary API choice, which is great, but requires a new style of parser. Furthermore, instead of rather simple lists of arguments suggestions, we get a root command tree which needs to be managed entirely differently than just simply removing offending strings from a mutable list (Bukkit API / legacy approach).
Goals
PlayerCommandSendListener
when PaperMC is used.AsyncPlayerSendCommandsListener
.AsyncPlayerSendCommandsListener
when PaperMC is used.Other
I plan to work on this. If you have worked with this event before, please feel free to let me know below, I would love some assistance :)
The text was updated successfully, but these errors were encountered: