From 52ce8ad8ae51383db1f049020e9f28c05f6bc288 Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Thu, 25 Mar 2021 19:17:16 +0000 Subject: [PATCH] Plugin: removed useless shit Plugin is the interface by which the server core interacts with plugins, so it should be limited only to the stuff that the server actually uses. These methods are still provided by PluginBase, so in 99.9% of cases there will be no BC break. --- changelogs/4.0-snapshot.md | 2 ++ src/plugin/Plugin.php | 4 ---- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/changelogs/4.0-snapshot.md b/changelogs/4.0-snapshot.md index 4a4fd5768..847a91705 100644 --- a/changelogs/4.0-snapshot.md +++ b/changelogs/4.0-snapshot.md @@ -665,6 +665,8 @@ This version features substantial changes to the network system, improving coher - `Plugin->onEnable()`: this is now internalized inside `PluginBase` - `Plugin->onDisable()`: same as above - `Plugin->onLoad()`: same as above + - `Plugin->getServer()` is no longer required to be implemented. It's implemented in `PluginBase` for convenience. + - `Plugin->isDisabled()` was removed (use `Plugin->isEnabled()` instead). - `Plugin` no longer extends `CommandExecutor`. This means that `Plugin` implementations don't need to implement `onCommand()` anymore. - The following hook methods have changed visibility: - `PluginBase->onEnable()` changed from `public` to `protected` diff --git a/src/plugin/Plugin.php b/src/plugin/Plugin.php index 12ed87dde..da313d07c 100644 --- a/src/plugin/Plugin.php +++ b/src/plugin/Plugin.php @@ -47,8 +47,6 @@ interface Plugin{ */ public function onEnableStateChange(bool $enabled) : void; - public function isDisabled() : bool; - /** * Gets the plugin's data folder to save files and configuration. * This directory name has a trailing slash. @@ -57,8 +55,6 @@ interface Plugin{ public function getDescription() : PluginDescription; - public function getServer() : Server; - public function getName() : string; public function getLogger() : \AttachableLogger;