Encapsulate plugin.yml commands handling inside PluginBase, removed CommandExecutor requirement from Plugin interface

This removes the need for custom Plugin implementations to implement onCommand().

In the future it's planned to remove plugin.yml commands completely and have them registered similarly to how events are handled.
This commit is contained in:
Dylan K. Taylor
2018-11-09 19:50:52 +00:00
parent 8b9ec5dde3
commit 3a6af3327f
4 changed files with 67 additions and 77 deletions

View File

@@ -1644,7 +1644,7 @@ class Server{
$this->resourceManager = new ResourcePackManager($this->getDataPath() . "resource_packs" . DIRECTORY_SEPARATOR, $this->logger);
$this->pluginManager = new PluginManager($this, $this->commandMap, ((bool) $this->getProperty("plugins.legacy-data-dir", true)) ? null : $this->getDataPath() . "plugin_data" . DIRECTORY_SEPARATOR);
$this->pluginManager = new PluginManager($this, ((bool) $this->getProperty("plugins.legacy-data-dir", true)) ? null : $this->getDataPath() . "plugin_data" . DIRECTORY_SEPARATOR);
$this->profilingTickRate = (float) $this->getProperty("settings.profile-report-trigger", 20);
$this->pluginManager->registerInterface(new PharPluginLoader($this->autoloader));
$this->pluginManager->registerInterface(new ScriptPluginLoader());