mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-20 11:39:43 +00:00
phar plugins should support multiple api versions
This commit is contained in:
parent
c104951763
commit
f933f4bec9
3 changed files with 6 additions and 3 deletions
|
|
@ -96,7 +96,10 @@ class LevelAPI{
|
|||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $name
|
||||
* @return Level|boolean
|
||||
*/
|
||||
public function get($name){
|
||||
if(isset($this->levels[$name])){
|
||||
return $this->levels[$name];
|
||||
|
|
|
|||
|
|
@ -148,7 +148,7 @@ class PluginAPI extends stdClass{
|
|||
console("[INFO] Loading PHAR plugin \"".FORMAT_GREEN.$pluginInfo["name"].FORMAT_RESET."\" ".FORMAT_AQUA.$pluginInfo["version"].FORMAT_RESET." by ".FORMAT_AQUA.$pluginInfo["author"].FORMAT_RESET);
|
||||
|
||||
$aver = CURRENT_API_VERSION;
|
||||
if($pluginInfo["api"] != $aver){
|
||||
if(!in_array((string) CURRENT_API_VERSION, $pluginInfo["api"])){
|
||||
console("[WARNING] API is not the same as Core, might cause bugs({$pluginInfo["api"]} != {$aver})");
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue