mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-23 00:55:57 +00:00
Expose plugin.yml contents to plugins (#2043)
This allows plugins and libraries to rely on values in plugin.yml without parsing it again
This commit is contained in:
parent
e7b2dc87d6
commit
6bf9ae0a18
@ -26,6 +26,8 @@ namespace pocketmine\plugin;
|
||||
use pocketmine\permission\Permission;
|
||||
|
||||
class PluginDescription{
|
||||
private $map;
|
||||
|
||||
private $name;
|
||||
private $main;
|
||||
private $api;
|
||||
@ -66,6 +68,8 @@ class PluginDescription{
|
||||
* @throws PluginException
|
||||
*/
|
||||
private function loadMap(array $plugin){
|
||||
$this->map = $plugin;
|
||||
|
||||
$this->name = $plugin["name"];
|
||||
if(preg_match('/^[A-Za-z0-9 _.-]+$/', $this->name) === 0){
|
||||
throw new PluginException("Invalid PluginDescription name");
|
||||
@ -287,4 +291,8 @@ class PluginDescription{
|
||||
public function getWebsite() : string{
|
||||
return $this->website;
|
||||
}
|
||||
|
||||
public function getMap() : array{
|
||||
return $this->map;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user