PluginBase
Implements Plugin, CommandExecutor
Methods
__construct()
public function __construct(\pocketmine\plugin\PluginLoader $loader, \pocketmine\Server $server, \pocketmine\plugin\PluginDescription $description, string $dataFolder, string $file, \pocketmine\plugin\ResourceProvider $resourceProvider)getCommand()
public function getCommand(string $name)getConfig()
public function getConfig() : \pocketmine\utils\ConfiggetDataFolder()
final public function getDataFolder() : stringgetDescription()
final public function getDescription() : \pocketmine\plugin\PluginDescriptiongetFile() protected
protected function getFile() : stringgetFullName()
final public function getFullName() : stringgetLogger()
public function getLogger() : \AttachableLoggergetName()
final public function getName() : stringgetPluginLoader()
public function getPluginLoader() : \pocketmine\plugin\PluginLoadergetResource()
public function getResource(string $filename)Deprecated
Prefer using standard PHP functions with PluginBase::getResourcePath(), like
Gets an embedded resource on the plugin file. WARNING: You must close the resource given using fclose()
getResourceFolder()
public function getResourceFolder() : stringReturns the path to the folder where the plugin's embedded resource files are usually located. Note: This is NOT the same as the data folder. The files in this folder should be considered read-only.
getResourcePath()
public function getResourcePath(string $filename) : stringReturns the full path to a data file in the plugin's resources folder. This path can be used with standard PHP functions like fopen() or file_get_contents().
Note: Any path returned by this function should be considered READ-ONLY.
getResources()
public function getResources() : arrayReturns all the resources packaged with the plugin in the form ["path/in/resources" => SplFileInfo]
getScheduler()
public function getScheduler() : \pocketmine\scheduler\TaskSchedulergetServer()
final public function getServer() : \pocketmine\ServerisDisabled()
final public function isDisabled() : boolisEnabled()
final public function isEnabled() : boolonCommand()
public function onCommand(\pocketmine\command\CommandSender $sender, \pocketmine\command\Command $command, string $label, array $args) : boolonDisable() protected
protected function onDisable() : voidCalled when the plugin is disabled Use this to free open things and finish actions
onEnable() protected
protected function onEnable() : voidCalled when the plugin is enabled
onLoad() protected
protected function onLoad() : voidCalled when the plugin is loaded, before calling onEnable()
reloadConfig()
public function reloadConfig() : voidsaveConfig()
public function saveConfig() : voidsaveDefaultConfig()
public function saveDefaultConfig() : boolsaveResource()
public function saveResource(string $filename, bool $replace = false) : boolSaves an embedded resource to its relative location in the data folder
