forked from Ad5001/UHC
Resolving some compatibility !
This commit is contained in:
parent
98db40563b
commit
8164e0af6a
2 changed files with 4 additions and 4 deletions
BIN
UHC.png
Normal file
BIN
UHC.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 14 KiB |
|
@ -163,14 +163,14 @@ switch($cmd->getName()){
|
|||
}
|
||||
}
|
||||
break;
|
||||
case "scenarios" {
|
||||
case "scenarios":
|
||||
if(isset($args[2])) {
|
||||
if(isset($this->worlds[$sender->getLevel()->getName()]) and !isset($this->games[$sender->getLevel()->getName()])) {
|
||||
if(file_exists($this->getDataFolder() . "scenarios/" . $args[2] . ".php")) { // yes, I'm treating args[2] before args[1] but who cares x) ?
|
||||
switch($args[1]) {
|
||||
case "add":
|
||||
$sl = new \pocketmine\plugin\ScriptPluginLoader($this->getServer());
|
||||
$scenarios[$args[2]] = $sl->load(realpath($this->getDataFolder() . "scenarios/" . $args[2] . ".php"));
|
||||
require_once(realpath($this->getDataFolder() . "scenarios/" . $args[2] . ".php"));
|
||||
$scenarios[$args[2]] = new $args[2]();
|
||||
$scenarios[$args[2]]->onEnable();
|
||||
break;
|
||||
case "remove":
|
||||
|
@ -181,7 +181,7 @@ switch($cmd->getName()){
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue