Browse Source

Resolving some compatibility !

master
Ad5001 3 years ago
parent
commit
8164e0af6a
2 changed files with 4 additions and 4 deletions
  1. BIN
      UHC.png
  2. 4
    4
      src/Ad5001/UHC/Main.php

BIN
UHC.png View File


+ 4
- 4
src/Ad5001/UHC/Main.php View File

@@ -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…
Cancel
Save