mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-10 21:45:35 +00:00
Make clear that Plugin->setEnabled() is @internal
Use of this by plugins will produce a lot of undefined behaviour, such as event handlers not being unregistered, scheduled tasks not being removed, and registered permissions causing memory leaks.
This commit is contained in:
parent
adbd1c7bed
commit
10fa74b417
@ -55,6 +55,12 @@ interface Plugin extends CommandExecutor{
|
|||||||
public function isEnabled() : bool;
|
public function isEnabled() : bool;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* Called by the plugin manager when the plugin is enabled or disabled to inform the plugin of its enabled state.
|
||||||
|
*
|
||||||
|
* @internal This is intended for core use only and should not be used by plugins
|
||||||
|
* @see PluginManager::enablePlugin()
|
||||||
|
* @see PluginManager::disablePlugin()
|
||||||
|
*
|
||||||
* @param bool $enabled
|
* @param bool $enabled
|
||||||
*/
|
*/
|
||||||
public function setEnabled(bool $enabled = true) : void;
|
public function setEnabled(bool $enabled = true) : void;
|
||||||
|
@ -93,6 +93,12 @@ abstract class PluginBase implements Plugin{
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* Called by the plugin manager when the plugin is enabled or disabled to inform the plugin of its enabled state.
|
||||||
|
*
|
||||||
|
* @internal This is intended for core use only and should not be used by plugins
|
||||||
|
* @see PluginManager::enablePlugin()
|
||||||
|
* @see PluginManager::disablePlugin()
|
||||||
|
*
|
||||||
* @param bool $enabled
|
* @param bool $enabled
|
||||||
*/
|
*/
|
||||||
final public function setEnabled(bool $enabled = true) : void{
|
final public function setEnabled(bool $enabled = true) : void{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user