public function onEnable() { $this->patternStore = new PatternStore(); $this->patternStore->loadClasses($this->getFile() . "src/" . str_replace("\\", "/", __NAMESPACE__) . "/pattern"); $this->chestDataStore = new FlatFileStore($this); $this->chestDataStore->load(); $this->getServer()->getCommandMap()->register("chestrefill", new ChestCommand($this)); }
private static function compareArray($template, $test) { foreach ($template as $i => $value) { if (is_array($value)) { if (!isset($test[$i])) { return false; } if (count($value) === 0) { continue; } if (PatternStore::compareArray($value, $test[$i])) { return false; } } elseif (!isset($test[$value])) { return false; } } return true; }