mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-07-03 16:49:53 +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;
|
use pocketmine\permission\Permission;
|
||||||
|
|
||||||
class PluginDescription{
|
class PluginDescription{
|
||||||
|
private $map;
|
||||||
|
|
||||||
private $name;
|
private $name;
|
||||||
private $main;
|
private $main;
|
||||||
private $api;
|
private $api;
|
||||||
@ -66,6 +68,8 @@ class PluginDescription{
|
|||||||
* @throws PluginException
|
* @throws PluginException
|
||||||
*/
|
*/
|
||||||
private function loadMap(array $plugin){
|
private function loadMap(array $plugin){
|
||||||
|
$this->map = $plugin;
|
||||||
|
|
||||||
$this->name = $plugin["name"];
|
$this->name = $plugin["name"];
|
||||||
if(preg_match('/^[A-Za-z0-9 _.-]+$/', $this->name) === 0){
|
if(preg_match('/^[A-Za-z0-9 _.-]+$/', $this->name) === 0){
|
||||||
throw new PluginException("Invalid PluginDescription name");
|
throw new PluginException("Invalid PluginDescription name");
|
||||||
@ -287,4 +291,8 @@ class PluginDescription{
|
|||||||
public function getWebsite() : string{
|
public function getWebsite() : string{
|
||||||
return $this->website;
|
return $this->website;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getMap() : array{
|
||||||
|
return $this->map;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user