mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-07 12:18:46 +00:00
Workaround for plugin versions being read as strings from plugin.yml
Config is a real pain in the ass to work with... need to split it up so this can be handled properly
This commit is contained in:
parent
7c00982fff
commit
cca9cf2c86
@ -69,9 +69,9 @@ class PluginDescription{
|
|||||||
throw new PluginException("Invalid PluginDescription name");
|
throw new PluginException("Invalid PluginDescription name");
|
||||||
}
|
}
|
||||||
$this->name = str_replace(" ", "_", $this->name);
|
$this->name = str_replace(" ", "_", $this->name);
|
||||||
$this->version = $plugin["version"];
|
$this->version = (string) $plugin["version"];
|
||||||
$this->main = $plugin["main"];
|
$this->main = $plugin["main"];
|
||||||
$this->api = !is_array($plugin["api"]) ? [$plugin["api"]] : $plugin["api"];
|
$this->api = array_map(function($v){ return (string) $v; }, !is_array($plugin["api"]) ? [$plugin["api"]] : $plugin["api"]);
|
||||||
if(stripos($this->main, "pocketmine\\") === 0){
|
if(stripos($this->main, "pocketmine\\") === 0){
|
||||||
throw new PluginException("Invalid PluginDescription main, cannot start within the PocketMine namespace");
|
throw new PluginException("Invalid PluginDescription main, cannot start within the PocketMine namespace");
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user