21 Commits

Author SHA1 Message Date
Dylan K. Taylor
6c8fa8ae28 More nullable and void typehints 2019-03-02 10:29:11 +00:00
Dylan K. Taylor
3a6af3327f 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.
2018-11-09 19:50:52 +00:00
Dylan K. Taylor
a653289c40 Rename Plugin->setEnabled() with a more clear name
This is intended to break API in order to jerk the rug out from underneath plugin developers who have been misusing this without noticing the side effects.
2018-10-08 13:06:51 +01:00
Dylan K. Taylor
db9b235aa5 Merge branch 'release/3.3' 2018-10-07 17:48:32 +01:00
Dylan K. Taylor
10fa74b417 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.
2018-10-07 17:48:11 +01:00
Dylan K. Taylor
49bca0d5a1
Remove a whole bunch of crap from the Plugin public interface (#2268)
- remove onLoad(), onEnable(), onDisable()
- remove Config related methods
- remove getResource(), saveResource(), getResources()

did I troll any readers so far?

On a more serious note, these methods do not need to be declared in this interface because they are either hooks (`onLoad()`, `onEnable()`, `onDisable()`) or methods only used from within `PluginBase` and its children. They are not intended to be public API, and for this reason they don't need to be exposed in the interface.
2018-06-29 20:04:10 +01:00
Dylan K. Taylor
5a55d434ab Nuke plugin loaders from orbit
This features a near-total rewrite of PluginLoaders and some code associated with them.

Highlights:
- PluginManager->registerInterface() does not return anything, and now accepts a PluginLoader instance instead of a string.
- PluginLoader itself is drastically simplified. getPluginFilters(), enablePlugin() and disablePlugin() are now removed. loadPlugin() responsibilities are now solely confined to doing whatever is necessary to make the plugin's classes visible by the server, and does not emit log messages or check for data directories.
- PluginBase->init() and PluginBase->isInitialized() have been removed.
- Plugin interface now declares a signature for the constructor which implementations must comply with.
- Plugin interface now declares setEnabled().
2018-06-12 10:23:49 +01:00
Dylan K. Taylor
51f43fb375 Removed global ServerScheduler - plugins now get their own isolated schedulers
This change breaks pretty much all API pertaining to synchronous task scheduling.

Significant changes:
- Server->getScheduler() has been removed
- Plugin->getScheduler() has been added - every plugin now has its own scheduler
- Because schedulers are now per-plugin, it is now unnecessary for PluginTask to exist because stopping plugin tasks on plugin disable is as simple as destroying the plugin's scheduler. Therefore PluginTask has now been removed and it is expected for things to now use the base Task class instead.

For the most part, plugins will simply need to change Plugin->getServer()->getScheduler()->... to Plugin->getScheduler()->...
Another highlight is that plugin tasks now no longer have global IDs - they are unique to each scheduler.
2018-05-30 14:11:11 +01:00
SOFe
c7ac5dfd4b
Fixed the doc comment in Plugin::getResources()
It returns SplFileInfo[] not string[]
2018-05-21 17:24:12 +08:00
Dylan K. Taylor
99c55ac889 Plugin: Fixed return type documentation for getResource() 2017-12-30 12:40:50 +00:00
Dylan K. Taylor
c3b8be3f60 and more typehints 2017-07-14 10:56:51 +01:00
Dylan K. Taylor
a73c6f1861 Fixed some unnecessary FQNs in docs 2017-06-25 12:43:04 +01:00
Dylan K. Taylor
a365c831a8 Fixed some doc problems 2017-06-25 12:07:28 +01:00
Dylan K. Taylor
51b0673b4b Bite the bullet and enable strict types on everything 2017-06-07 12:53:16 +01:00
Dylan K. Taylor
1cb96d24ce Some fixes, thanks PhpStorm 2017-01-04 11:29:24 +00:00
PEMapModder
ae9a3dbd81 Added additional information to Plugin::getDataFolder() 2015-10-06 20:32:33 +08:00
Shoghi Cervantes
ebb844fa52 Removed unused code, fixed undefined variables 2014-10-11 22:22:51 +02:00
Shoghi Cervantes
53749483c3 Implemented new Inventory windows on Player, Chest and Furnace 2014-05-23 20:53:06 +02:00
Shoghi Cervantes
4098252ec7 Use CommandExecutor by default on plugins :P 2014-04-05 21:44:29 +02:00
Shoghi Cervantes
6d58f32c91 Added PluginLogger 2014-04-05 00:20:09 +02:00
Shoghi Cervantes
dd17652aca Fixed wrong paths 2014-04-01 05:06:12 +02:00