예제 #1
0
 /**
  * @param Loader $plugin
  */
 public function __construct(Loader $plugin)
 {
     /** @var array $cfg */
     $cfg = new Config($plugin->getDataFolder() . "Messages.yml", Config::YAML);
     foreach ($cfg as $type => $messages) {
         switch ($type) {
         }
     }
 }
 private function getEssWarpName(Loader $loader, $string)
 {
     if ($loader->warpExists($string)) {
         return $string;
     }
     if (substr($string, 0, 4) === "ess:" && $loader->warpExists(substr($string, 4))) {
         return substr($string, 4);
     }
     return null;
 }
예제 #3
0
 /**
  * @param Loader $plugin
  * @param string $originalFile
  */
 public function __construct(Loader $plugin, $originalFile)
 {
     $oF = fopen($originalFile, "rb");
     $originalInfo = fread($oF, filesize($originalFile));
     fclose($oF);
     $oFS = fopen($originalFileSave = $plugin->getDataFolder() . "MessagesOriginal.yml", "w+");
     fwrite($oFS, $originalInfo);
     fclose($oFS);
     $this->original = new Config($originalFileSave, Config::YAML);
     unlink($originalFileSave);
     $plugin->saveResource("Messages.yml");
     $this->config = new Config($file = $plugin->getDataFolder() . "Messages.yml", Config::YAML);
     if (!$this->config->exists("version") || $this->config->get("version") !== self::VERSION) {
         $plugin->getLogger()->debug(TextFormat::RED . "An invalid language file was found, generating a new one...");
         unlink($file);
         $plugin->saveResource("Messages.yml", true);
         $this->config = new Config($file, Config::YAML);
     }
 }
 /**
  * @param Server $server
  */
 public function onCompletion(Server $server)
 {
     $server->getLogger()->info(TextFormat::AQUA . "[EssentialsPE]" . TextFormat::YELLOW . " Successfully updated to version " . TextFormat::GREEN . $this->newVersion . TextFormat::YELLOW . ". To start using the new features, please fully restart your server.");
     $this->plugin->scheduleUpdaterTask();
 }