mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-08 02:42:58 +00:00
Require opting into receiving cancelled events instead of opting out (#2906)
Warning for plugin developers: This is a silent BC break. It won't raise any errors. This alters the default behaviour of event handlers to **not** receive cancelled events by default. It is now required to opt into receiving cancelled events by using the @handleCancelled directive (or the handleCancelled parameter where it's appropriate). The ambiguous @ignoreCancelled directive is now ignored. Ramifications: - The majority of handlers with `if($event->isCancelled()) return;` no longer need such checks. - Handlers with `@ignoreCancelled true` or `@ignoreCancelled` annotations can have them removed. - Handlers which want to receive cancelled events need to use `@handleCancelled`.
This commit is contained in:
@ -46,7 +46,7 @@ use pocketmine\plugin\PluginManager;
|
||||
* - `@softDepend [PluginName]`: Handler WILL NOT be registered if its event doesn't exist. Useful for soft-depending
|
||||
* on plugin events. Plugin name is optional.
|
||||
* Example: `@softDepend SimpleAuth`
|
||||
* - `@ignoreCancelled`: Cancelled events WILL NOT be passed to this handler.
|
||||
* - `@handleCancelled`: Cancelled events will STILL invoke this handler.
|
||||
* - `@priority <PRIORITY>`: Sets the priority at which this event handler will receive events.
|
||||
* Example: `@priority HIGHEST`
|
||||
* @see EventPriority for a list of possible options.
|
||||
|
Reference in New Issue
Block a user