PocketMine-MP 5.21.2 git-a6534ecbbbcf369264567d27e5ed70f7f5be9816
Loading...
Searching...
No Matches
pocketmine\plugin\PluginManager Class Reference
+ Collaboration diagram for pocketmine\plugin\PluginManager:

Public Member Functions

 __construct (private Server $server, private ?string $pluginDataDirectory, private ?PluginGraylist $graylist=null)
 
 disablePlugins ()
 
 enablePlugin (Plugin $plugin)
 
 getPlugin (string $name)
 
 getPlugins ()
 
 isPluginEnabled (Plugin $plugin)
 
 loadPlugins (string $path, int &$loadErrorCount=0)
 
 registerEvent (string $event, \Closure $handler, int $priority, Plugin $plugin, bool $handleCancelled=false)
 
 registerEvents (Listener $listener, Plugin $plugin)
 
 registerInterface (PluginLoader $loader)
 
 tickSchedulers (int $currentTick)
 

Protected Attributes

array $enabledPlugins = []
 
array $fileAssociations = []
 
array $plugins = []
 

Detailed Description

Manages all the plugins

Definition at line 71 of file PluginManager.php.

Constructor & Destructor Documentation

◆ __construct()

pocketmine\plugin\PluginManager::__construct ( private Server $server,
private ?string $pluginDataDirectory,
private ?PluginGraylist $graylist = null )

Definition at line 89 of file PluginManager.php.

Member Function Documentation

◆ disablePlugins()

pocketmine\plugin\PluginManager::disablePlugins ( )

Definition at line 490 of file PluginManager.php.

◆ enablePlugin()

pocketmine\plugin\PluginManager::enablePlugin ( Plugin $plugin)

Definition at line 448 of file PluginManager.php.

◆ getPlugin()

pocketmine\plugin\PluginManager::getPlugin ( string $name)

Definition at line 103 of file PluginManager.php.

◆ getPlugins()

pocketmine\plugin\PluginManager::getPlugins ( )
Returns
Plugin[]

Definition at line 118 of file PluginManager.php.

◆ isPluginEnabled()

pocketmine\plugin\PluginManager::isPluginEnabled ( Plugin $plugin)

Definition at line 444 of file PluginManager.php.

◆ loadPlugins()

pocketmine\plugin\PluginManager::loadPlugins ( string $path,
int & $loadErrorCount = 0 )
Returns
Plugin[]

Definition at line 346 of file PluginManager.php.

◆ registerEvent()

pocketmine\plugin\PluginManager::registerEvent ( string $event,
\Closure $handler,
int $priority,
Plugin $plugin,
bool $handleCancelled = false )
Parameters
string$eventClass name that extends Event

@phpstan-template TEvent of Event @phpstan-param class-string<TEvent> $event @phpstan-param \Closure(TEvent) : void $handler

Exceptions

ReflectionException

Definition at line 633 of file PluginManager.php.

◆ registerEvents()

pocketmine\plugin\PluginManager::registerEvents ( Listener $listener,
Plugin $plugin )

Registers all the events in the given Listener class

Exceptions
PluginException

Definition at line 578 of file PluginManager.php.

◆ registerInterface()

pocketmine\plugin\PluginManager::registerInterface ( PluginLoader $loader)

Definition at line 111 of file PluginManager.php.

◆ tickSchedulers()

pocketmine\plugin\PluginManager::tickSchedulers ( int $currentTick)

Definition at line 526 of file PluginManager.php.

Member Data Documentation

◆ $enabledPlugins

array pocketmine\plugin\PluginManager::$enabledPlugins = []
protected

Definition at line 76 of file PluginManager.php.

◆ $fileAssociations

array pocketmine\plugin\PluginManager::$fileAssociations = []
protected

Definition at line 87 of file PluginManager.php.

◆ $plugins

array pocketmine\plugin\PluginManager::$plugins = []
protected

Definition at line 73 of file PluginManager.php.


The documentation for this class was generated from the following file: