Exemple #1
0
 public function onEnable()
 {
     if (!file_exists($this->getDataFolder())) {
         mkdir($this->getDataFolder());
     }
     $this->saveResource("ShopText.yml");
     $this->saveResource("language.properties");
     $this->saveDefaultConfig();
     $this->shop = (new Config($this->getDataFolder() . "Shops.yml", Config::YAML))->getAll();
     $this->shopText = new Config($this->getDataFolder() . "ShopText.yml", Config::YAML);
     $this->lang = new Config($this->getDataFolder() . "language.properties", Config::PROPERTIES);
     $this->getServer()->getPluginManager()->registerEvents($this, $this);
     $this->itemcloud = MainClass::getInstance();
     $this->tap = [];
     $this->placeQueue = [];
 }
Exemple #2
0
 public function onEnable()
 {
     if (!file_exists($this->getDataFolder())) {
         mkdir($this->getDataFolder());
     }
     if (!class_exists("\\onebone\\itemcloud\\MainClass", false)) {
         $this->getLogger()->critical("[DEPENDENCY] Please install ItemCloud plugin to use PShop plugin.");
         return;
     }
     if (!class_exists("\\onebone\\economyapi\\EconomyAPI", false)) {
         $this->getLogger()->critical("[DEPENDENCY] Please install EconomyAPI plugin to use PShop plugin.");
         return;
     }
     $this->saveResource("ShopText.yml");
     $this->saveResource("language.properties");
     $this->saveDefaultConfig();
     $this->shop = (new Config($this->getDataFolder() . "Shops.yml", Config::YAML))->getAll();
     $this->shopText = new Config($this->getDataFolder() . "ShopText.yml", Config::YAML);
     $this->lang = new Config($this->getDataFolder() . "language.properties", Config::PROPERTIES);
     $this->getServer()->getPluginManager()->registerEvents($this, $this);
     $this->itemcloud = \onebone\itemcloud\MainClass::getInstance();
     $this->tap = [];
     $this->placeQueue = [];
 }