mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-07 12:18:46 +00:00
Make plugin load errors more descriptive
This commit is contained in:
parent
517609dc2e
commit
c81b76cbf6
@ -1 +1 @@
|
|||||||
Subproject commit eac602e8bc084fbaf3bc133129d6c8e4dc517c52
|
Subproject commit 9868a649ad9151d9724298b4fcf3345eab9ea409
|
@ -255,24 +255,20 @@ class PluginManager{
|
|||||||
}
|
}
|
||||||
|
|
||||||
if($compatible === false){
|
if($compatible === false){
|
||||||
$this->server->getLogger()->error($this->server->getLanguage()->translateString("pocketmine.plugin.loadError", [$name, "%pocketmine.plugin.incompatibleAPI"]));
|
$this->server->getLogger()->error($this->server->getLanguage()->translateString("pocketmine.plugin.loadError", [
|
||||||
|
$name,
|
||||||
|
$this->server->getLanguage()->translateString("%pocketmine.plugin.incompatibleAPI", [implode(", ", $description->getCompatibleApis())])
|
||||||
|
]));
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(count($pluginMcpeProtocols = $description->getCompatibleMcpeProtocols()) > 0){
|
if(count($pluginMcpeProtocols = $description->getCompatibleMcpeProtocols()) > 0){
|
||||||
$serverMcpeProtocols = [ProtocolInfo::CURRENT_PROTOCOL];
|
$serverMcpeProtocols = [ProtocolInfo::CURRENT_PROTOCOL];
|
||||||
if(count(array_intersect($pluginMcpeProtocols, $serverMcpeProtocols)) === 0){
|
if(count(array_intersect($pluginMcpeProtocols, $serverMcpeProtocols)) === 0){
|
||||||
$this->server->getLogger()->error($this->server->getLanguage()->translateString(
|
$this->server->getLogger()->error($this->server->getLanguage()->translateString("pocketmine.plugin.loadError", [
|
||||||
"pocketmine.plugin.loadError",
|
$name,
|
||||||
[
|
$this->server->getLanguage()->translateString("%pocketmine.plugin.incompatibleProtocol", [implode(", ", $pluginMcpeProtocols)])
|
||||||
$name,
|
]));
|
||||||
$this->server->getLanguage()->translateString(
|
|
||||||
"%pocketmine.plugin.incompatibleProtocol",
|
|
||||||
[
|
|
||||||
implode(", ", $pluginMcpeProtocols)
|
|
||||||
])
|
|
||||||
]
|
|
||||||
));
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -306,7 +302,10 @@ class PluginManager{
|
|||||||
if(isset($loadedPlugins[$dependency]) or $this->getPlugin($dependency) instanceof Plugin){
|
if(isset($loadedPlugins[$dependency]) or $this->getPlugin($dependency) instanceof Plugin){
|
||||||
unset($dependencies[$name][$key]);
|
unset($dependencies[$name][$key]);
|
||||||
}elseif(!isset($plugins[$dependency])){
|
}elseif(!isset($plugins[$dependency])){
|
||||||
$this->server->getLogger()->critical($this->server->getLanguage()->translateString("pocketmine.plugin.loadError", [$name, "%pocketmine.plugin.unknownDependency"]));
|
$this->server->getLogger()->critical($this->server->getLanguage()->translateString("pocketmine.plugin.loadError", [
|
||||||
|
$name,
|
||||||
|
$this->server->getLanguage()->translateString("%pocketmine.plugin.unknownDependency", [$dependency])
|
||||||
|
]));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user