mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-03 08:35:20 +00:00
Implemented #3836: Replace setCancelled() in events with cancel() and uncancel()
The motivation for this is to prevent passing a dynamic argument to cancellation, which in almost all cases is a bug in user code. This same mistake also appears in a few places in the PM core (as seen in this commit), but in those cases the mistakes were mostly harmless since they were taking place before the event was actually called. closes #3836
This commit is contained in:
@ -51,7 +51,7 @@ class Main extends PluginBase implements Listener{
|
||||
//be asynchronous tests running. Instead we cancel this and stop the server of our own accord once all tests
|
||||
//have completed.
|
||||
if($event->getCommand() === "stop"){
|
||||
$event->setCancelled();
|
||||
$event->cancel();
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user