PocketMine-MP icon indicating copy to clipboard operation
PocketMine-MP copied to clipboard

Remove PlayerCommandPreProcessEvent

Open dktapps opened this issue 4 years ago • 7 comments

Description

PlayerCommandPreProcessEvent no longer has any practical value and is confusing. It should be removed.

Justification

From Discord #internals-dev from 2019 chat logs (https://discord.com/channels/373199722573201408/546255162222706696/595894033256153128)

  • it confuses people
  • it doesn't really serve any purpose since the introduction of CommandEvent
  • if you wanted to convert a chat message into a command, you can do so without the use of the preprocess event - it would make more sense to cancel the chat message and send the command via Server->dispatchCommand()

dktapps avatar Jun 26 '21 16:06 dktapps

Can't think of any practical usage anymore except stupid priority overriding.

SOF3 avatar Jun 26 '21 17:06 SOF3

Make it send warnings in the console while devtools is installed, I think removing it would just be an annoyance for most people.

Xd-pro avatar Oct 10 '21 17:10 Xd-pro

As I wrote in the original post, there is no practical use case for it in modern times. Therefore, the only people who will be annoyed are the people who are still using it for some purpose that they don't need it for.

dktapps avatar Oct 10 '21 17:10 dktapps

I'm referring to people using public plugins that use this event. Backwards compatibility is important.

Xd-pro avatar Oct 10 '21 17:10 Xd-pro

The issue is clearly labelled "BC break" for a reason ...

dktapps avatar Oct 10 '21 17:10 dktapps

Impact analysis via Poggit suggests that the impact of this is zero for public plugins (no usages from PM4 plugins, and only 1 PM3 plugin used it).

dktapps avatar May 21 '22 19:05 dktapps

I'm referring to people using public plugins that use this event. Backwards compatibility is important.

People currently using PlayerCommandPreprocessEvent are mostly misusing it. That's exactly why we are removing it.

SOF3 avatar May 22 '22 01:05 SOF3