Separate names with a comma.
Comments in 'Plugin Development' started by Sensej, Oct 4, 2014.
Learn how to register Plugin Tasks from the src pocketmine code, it's pretty simple
Task ≠ PluginTask.
The first is always recommended and the second is bad practice in plugin development conventions. I only use the second when I need to make a quick call to some server function inside a class which is going to be run Asynchronously, so as not to have to clean up the reference later.
You mean use that function in other threads?
So what i can do if i already extend the PluginBase?
Well, do you know what PluginBase, PluginTask and Listener are respectively, and what is meant by extending/implementing them?
Yes i know
Then why do you make a PluginTask implement a Listener?
Cause the PluginTask include the $this->getOwner() methode
-_-" I want to throw my phone out of the window, but the window is shut.
You don't extend/implement a class/interface to get its functions... Why can't you just use $this at the main class?
No, but if I have an AsyncTask which is not yet running but has to do something (like schedule itself). I don't want to have to cleanup the reference to the PluginBase or Server when it decides to run.
THANK U SENSEI