setLine() public method

public setLine ( integer $index, string $line )
$index integer 0-3
$line string
Beispiel #1
0
 public function signchange(SignChangeEvent $event)
 {
     $event->setLine(0, "sJimin's");
     $event->setLine(1, "First");
     $event->setLine(2, "Plugin");
     $event->setLine(3, "work!");
 }
Beispiel #2
0
 public function onSign(SignChangeEvent $event)
 {
     $event->setLine(0, $this->replaceColor($event->getLine(0)));
     $event->setLine(1, $this->replaceColor($event->getLine(1)));
     $event->setLine(2, $this->replaceColor($event->getLine(2)));
     $event->setLine(3, $this->replaceColor($event->getLine(3)));
 }
 public function onSign(SignChangeEvent $event)
 {
     if ($event->getLine(0) == "[워프]" or $event->getLine(0) == "워프") {
         $player = $event->getPlayer();
         if (!$player->hasPermission("nyduscanal.commands.addwarp")) {
             $player->sendMessage(TextFormat::DARK_AQUA . "포탈생성권한이 없습니다.");
             $event->setCancelled();
             return false;
         }
         if (!isset(explode("[", $event->getLine(1))[1])) {
             if (!isset($this->NydusCanal_List["warp"][$event->getLine(1)])) {
                 $player->sendMessage(TextFormat::DARK_AQUA . "해당하는 워프포인트가 없습니다.");
                 $event->setCancelled();
                 return false;
             }
         }
         $event->setLine(0, "[워프]");
         if (isset($this->NydusCanal_List["warp"][$event->getLine(1)]["price"])) {
             if (isset(explode("+", $this->NydusCanal_List["warp"][$event->getLine(1)]["price"])[1])) {
                 $event->setLine(2, "보상:" . explode("+", $this->NydusCanal_List["warp"][$event->getLine(1)]["price"])[1] . "\$");
             } else {
                 $event->setLine(2, "비용:" . $this->NydusCanal_List["warp"][$event->getLine(1)]["price"] . "\$");
             }
         }
         $player->sendMessage("포탈생성이 완료되었습니다.");
         $block = $event->getBlock();
         $this->NydusCanal_List["signs"][$player->getLevel()->getFolderName()][$block->x . ":" . $block->y . ":" . $block->z] = $event->getLine(1);
         if ($event->getLine(2) == "x") {
             $this->NydusCanal_List["touch-signs"][$player->getLevel()->getFolderName()][$block->x . ":" . $block->y . ":" . $block->z] = 1;
             $event->setLine(2, "");
         }
     }
 }
 public function onSignChange(SignChangeEvent $event)
 {
     $player = $event->getPlayer();
     if ($event->isCancelled()) {
         return;
     }
     if ($event->getLine(0) == "색상체크" or $event->getLine(0) == "colorcheck") {
         $event->setLine(0, "[색상체크]");
         $event->setLine(1, "표지판을 터치시");
         $event->setLine(2, "본인의 위험지수와");
         $event->setLine(3, "색상체크가 뜹니다");
         $player->sendMessage(TextFormat::DARK_AQUA . "[PSYCHOPASS-API] 색상체크 표지판을 생성했습니다");
     }
 }
Beispiel #5
0
 public function SignPlace(SignChangeEvent $event)
 {
     if ($event->getLine(0) != $this->get("sign-set-message") and $event->getLine(0) != $this->get("sign-message")) {
         return;
     }
     $block = $event->getBlock();
     if ($event->getLine(1) == null) {
         $event->getPlayer()->sendMessage(TextFormat::RED . $this->get("command-zero"));
         return;
     }
     if (isset(explode("/", $event->getLine(1), 2)[1])) {
         $this->configData["{$block->x}:{$block->y}:{$block->z}"] = explode("/", $event->getLine(1), 2)[1];
         $event->setLine(0, $this->get("sign-message"));
     } else {
         $this->configData["{$block->x}:{$block->y}:{$block->z}"] = $event->getLine(1);
         $event->setLine(0, $this->get("sign-message"));
     }
 }
Beispiel #6
0
 public function onSignChange(SignChangeEvent $event)
 {
     $player = $event->getPlayer();
     if ($event->getLine(0) == "givemoney") {
         if (!$player->isOp()) {
             $player->sendMessage(TextFormat::RED . "OP만 사용가능합니다");
             return;
         }
         if (!is_numeric($event->getLine(1))) {
             $player->sendMessage(TextFormat::RED . "두번째는 반드시 숫자로해야합....설치Fail");
             return;
         }
         $event->setLine(0, "[터치시 돈 획득]");
         $event->setLine(1, "보상: " . "\$" . $event->getLine(1));
         $event->setLine(2, "주의 ! 하루에");
         $event->setLine(3, "한번씩만 가능합니다 !");
         $player->sendMessage(TextFormat::DARK_AQUA . "세팅완료 ! ㅇㅁㅇ! ");
     }
 }
 public function tileupdate(SignChangeEvent $event)
 {
     if ($event->getBlock()->getID() == Item::SIGN_POST || $event->getBlock()->getID() == Block::SIGN_POST || $event->getBlock()->getID() == Block::WALL_SIGN) {
         $signTile = $event->getPlayer()->getLevel()->getTile($event->getBlock());
         if (!$signTile instanceof Sign) {
             return true;
         }
         $signLines = $event->getLines();
         if ($signLines[0] == OneVsOne::SIGN_TITLE) {
             if ($event->getPlayer()->isOp()) {
                 $this->arenaManager->addSign($signTile);
                 $event->setLine(1, "-Waiting: " . $this->arenaManager->getNumberOfPlayersInQueue());
                 $event->setLine(2, "-Arenas:" . $this->arenaManager->getNumberOfFreeArenas());
                 $event->setLine(3, "-+===+-");
                 return true;
             }
         }
     }
 }
Beispiel #8
0
 public function onSignChange(SignChangeEvent $event)
 {
     if ($event->getBlock()->getId() == 68 || $event->getBlock()->getId() == 63) {
         $sign = $event->getPlayer()->getLevel()->getTile($event->getBlock());
         if ($event->getLine(0) == "§l§4[Brawl]" && $event->getPlayer()->isOp()) {
             $event->setLine(0, "§l§4[Brawl]");
             if ($world = $this->getServer()->getLevelByName("worldname")) {
                 $count = count($world->getPlayers());
                 $event->getLine(1);
                 $event->getLine(2);
                 $event->setLine(1, "§l§bPVP - BL !");
                 $event->setLine(2, "[{$count}/8]");
                 $player = $event->getPlayer();
                 $player->sendMessage("[PVPBRAWL] Succefully created !");
                 //create a new sign
             }
         }
     }
 }
Beispiel #9
0
 public function onSignChange(SignChangeEvent $event)
 {
     if ($event->getBlock()->getID() == 323 || $event->getBlock()->getID() == 63 || $event->getBlock()->getID() == 68) {
         $sign = $event->getPlayer()->getLevel()->getTile($event->getBlock());
         if (!$sign instanceof Sign) {
             return;
         }
         $sign = $event->getLines();
         if ($sign[0] == '[Bail]' || $sign[0] == "&6[&4Bail&6]" || $sign[0] == '§6[§4Bail§6]') {
             if ($event->getPlayer()->hasPermission("jail.sign.create") || $event->getPlayer()->hasPermission("jail.sign.create.bail")) {
                 $event->setLine(0, "§6[§4Bail§6]");
                 $event->getPlayer()->sendMessage($this->getPlugin()->colourMessage("&aYou created a bail sign!"));
             } else {
                 $event->setLine(0, null);
                 $event->setLine(1, null);
                 $event->setLine(2, null);
                 $event->setLine(3, null);
                 $event->getPlayer()->sendMessage($this->getPlugin()->colourMessage("&cYou don't have permission for this!"));
             }
         }
     }
 }
Beispiel #10
0
 public function SignChangedEvent(SignChangeEvent $event)
 {
     if ($event->getLine(0) === "엘레베이터" && $event->getLine(1) === "상승") {
         $event->setLine(0, TextFormat::GOLD . "==========");
         $event->setLine(1, TextFormat::RED . "[엘" . TextFormat::GOLD . "레" . TextFormat::YELLOW . "베" . TextFormat::GREEN . "이" . TextFormat::BLUE . "터]");
         $event->setLine(2, TextFormat::RED . "↑↑상승↑↑");
         $event->setLine(3, TextFormat::GOLD . "==========");
     }
     if ($event->getLine(0) == "엘레베이터" && $event->getLine(1) == "하강") {
         $event->setLine(0, TextFormat::GOLD . "==========");
         $event->setLine(1, TextFormat::RED . "[엘" . TextFormat::GOLD . "레" . TextFormat::YELLOW . "베" . TextFormat::GREEN . "이" . TextFormat::BLUE . "터]");
         $event->setLine(2, TextFormat::RED . "↓↓하강↓↓");
         $event->setLine(3, TextFormat::GOLD . "==========");
     }
 }
Beispiel #11
0
 public function onSignChange(SignChangeEvent $event)
 {
     $getLine0 = $event->getLine(0);
     $getLine1 = $event->getLine(1);
     $player = $event->getPlayer();
     $effectType = array("1", "2", "3", "4", "5", "8", "9", "10", "11", "12", "13", "14", "18", "19", "20", "21");
     foreach ($effectType as $effectArray) {
         if ($getLine0 == "effect" && $getLine1 == $effectArray) {
             $event->setLine(0, "-----------");
             $event->setLine(1, TextFormat::RED . "[E" . TextFormat::GOLD . "f" . TextFormat::YELLOW . "f" . TextFormat::GREEN . "e" . TextFormat::BLUE . "c" . TextFormat::DARK_PURPLE . "t]");
             $event->setLine(2, TextFormat::AQUA . EffectName::getEffect($effectArray)->getName());
             $event->setLine(3, "-----------");
         }
         if ($getLine0 == "effect" && $getLine1 == "remove") {
             $event->setLine(0, "-----------");
             $event->setLine(1, TextFormat::RED . "[E" . TextFormat::GOLD . "f" . TextFormat::YELLOW . "f" . TextFormat::GREEN . "e" . TextFormat::BLUE . "c" . TextFormat::DARK_PURPLE . "t]");
             $event->setLine(2, TextFormat::AQUA . "효과제거");
             $event->setLine(3, "-----------");
         }
     }
 }
 public function onSignChange(SignChangeEvent $event)
 {
     $player = $event->getPlayer();
     if ($player->hasPermission("worldstats.place")) {
         if (TextFormat::clean(strtolower(trim($event->getLine(0)))) === strtolower(trim($this->sign->get("sign_trigger"))) || TextFormat::clean(strtolower(trim($event->getLine(0)))) === strtolower(trim($this->sign->get("sign_final_change")))) {
             $world = $event->getLine(1);
             $level = $this->getServer()->getLevelByName($world);
             if ($level instanceof Level) {
                 $players = count($level->getPlayers());
                 $event->setLine(0, TextFormat::GREEN . $this->sign->get("sign_final_change"));
                 $event->setLine(2, TextFormat::YELLOW . $players . TextFormat::RED . " players");
             } else {
                 $event->setLine(0, TextFormat::DARK_RED . "()()()()()()");
                 $event->setLine(1, TextFormat::DARK_RED . "*****");
                 $event->setLine(2, TextFormat::RED . "World Name Error");
                 $event->setLine(3, TextFormat::DARK_RED . "******");
             }
         }
     } else {
         $player->sendMessage(TextFormat::RED . "You do not have permission to create a World Status sign.");
         $event->setCancelled(true);
     }
 }
Beispiel #13
0
 public function tileupdate(SignChangeEvent $event)
 {
     if ($event->getBlock()->getID() == 323 || $event->getBlock()->getID() == 63 || $event->getBlock()->getID() == 68) {
         Server::getInstance()->broadcastMessage("DebugASignHasBeenPlaced");
         //DEBUG$sign = $event->getPlayer()->getLevel()->getTile($event->getBlock());
         if (!$sign instanceof Sign) {
             return true;
         }
         $sign = $event->getLines();
         if ($sign[0] === $this->plugin->getConfig()->get("SignToChange")) {
             # On placing block
             $event->setLine(0, TextFormat::YELLOW . $this->plugin->getConfig()->get("SignChanged"));
         }
         if ($sign[0] === TextFormat::YELLOW . $this->plugin->getConfig()->get("SignChanged")) {
             // Default values
             $colors = [C::BLACK, C::DARK_BLUE, C::DARK_GREEN, C::DARK_AQUA, C::DARK_RED, C::DARK_PURPLE, C::GOLD, C::GRAY, C::DARK_GRAY, C::BLUE, C::GREEN, C::AQUA, C::RED, C::LIGHT_PURPLE, C::YELLOW, C::WHITE];
             $lastcolor = "§mc";
             // Line 2
             $randcolors = rand(0, 15);
             $color = [C::BLACK, C::BOLD, C::STRIKETHROUGH, C::BLUE, C::RESET, $colors[$randcolors]];
             $line1 = $sign[1];
             $line1 = str_replace($lastcolor, implode("", $color), $line1);
             $lastcolor = implode("", $color);
             $event->setLine(1, $line1);
             // Line 3
             $randcolors = rand(0, 15);
             $color = [C::BLACK, C::BOLD, C::STRIKETHROUGH, C::BLUE, C::RESET, $colors[$randcolors]];
             $line2 = $sign[2];
             $line2 = str_replace($lastcolor, implode("", $color), $line2);
             $lastcolor = implode("", $color);
             $event->setLine(2, $line2);
             // Line 4
             $randcolors = rand(0, 15);
             $color = [C::BLACK, C::BOLD, C::STRIKETHROUGH, C::BLUE, C::RESET, $colors[$randcolors]];
             $line3 = $sign[3];
             $line3 = str_replace($lastcolor, implode("", $color), $line3);
             $lastcolor = implode("", $color);
             $event->setLine(3, $line3);
         }
     }
 }
Beispiel #14
0
 public function onSignChange(SignChangeEvent $event)
 {
     if (($data = $this->checkTag($event->getLine(0), $event->getLine(1))) !== false) {
         $player = $event->getPlayer();
         if (!$player->hasPermission("economyairport.create")) {
             $player->sendMessage($this->getMessage("no-permission-create"));
             return;
         }
         $block = $event->getBlock();
         switch ($event->getLine(1)) {
             case "departure":
                 if (!is_numeric($event->getLine(2))) {
                     $player->sendMessage($this->getMessage("cost-must-be-numeric"));
                     break;
                 }
                 if (trim($event->getLine(3)) === "") {
                     $player->sendMessage($this->getMessage("no-target-airport"));
                     break;
                 }
                 foreach ($this->airport as $d) {
                     if ($d["type"] === 1 and $d["name"] === $event->getLine(3)) {
                         $targetX = $d[0];
                         $targetY = $d[1];
                         $targetZ = $d[2];
                         $targetLevel = $d[3];
                         break;
                     }
                 }
                 if (!isset($targetX)) {
                     $player->sendMessage($this->getMessage("no-arrival"));
                     break;
                 }
                 $this->airport[$block->getX() . ":" . $block->getY() . ":" . $block->getZ() . ":" . $block->getLevel()->getFolderName()] = array("type" => 0, "cost" => $cost = round($event->getLine(2)), "target" => $event->getLine(3), "targetX" => $targetX, "targetY" => $targetY, "targetZ" => $targetZ, "targetLevel" => $targetLevel);
                 $mu = EconomyAPI::getInstance()->getMonetaryUnit();
                 $event->setLine(0, str_replace("%MONETARY_UNIT%", $mu, $data[0]));
                 $event->setLine(1, str_replace("%MONETARY_UNIT%", $mu, $data[1]));
                 $event->setLine(2, str_replace(["%1", "%MONETARY_UNIT%"], [$cost, $mu], $data[2]));
                 $event->setLine(3, str_replace(["%2", "%MONETARY_UNIT%"], [$event->getLine(3)], $data[3]));
                 $player->sendMessage($this->getMessage("departure-created", [$event->getLine(3), $cost]));
                 break;
             case "arrival":
                 if (trim($event->getLine(2)) === "") {
                     $player->sendMessage($this->getMessage("no-airport-name"));
                     break;
                 }
                 if (strpos($event->getLine(2), ":")) {
                     $player->sendMessage($this->getMessage("invalid-airport-name"));
                     break;
                 }
                 $this->airport[$block->getX() . ":" . $block->getY() . ":" . $block->getZ() . ":" . $block->getLevel()->getFolderName()] = array($block->getX(), $block->getY(), $block->getZ(), $block->getLevel()->getFolderName(), "name" => $event->getLine(2), "type" => 1);
                 $player->sendMessage($this->getMessage("arrival-created", [$event->getLine(2), "%2"]));
                 $event->setLine(0, $data[0]);
                 $event->setLine(1, $data[1]);
                 $event->setLine(2, str_replace("%1", $event->getLine(2), $data[2]));
                 $event->setLine(3, "");
                 break;
         }
     }
 }
Beispiel #15
0
 public function onSignChange(SignChangeEvent $event)
 {
     $str = $event->getLines();
     if (strtolower($str[0]) !== "[exchange]") {
         return;
     }
     if (!$event->getPlayer()->hasPermission("exchange.create")) {
         $event->getPlayer()->sendMessage(TextFormat::RED . self::getTranslation("NO_PERMISSION_CREATE"));
         return;
     }
     $returnVal = $this->addShop($event->getBlock(), $event->getPlayer(), $str[1], $str[2], $str[3]);
     if ($returnVal === self::FROM_NOT_FOUND) {
         $event->getPlayer()->sendMessage(TextFormat::RED . self::getTranslation("FROM_NOT_FOUND"));
         return;
     } elseif ($returnVal === self::TO_NOT_FOUND) {
         $event->getPlayer()->sendMessage(TextFormat::RED . self::getTranslation("TO_NOT_FOUND"));
         return;
     }
     $shopData = $this->shops[$returnVal];
     $event->setLine(0, self::getTranslation("EXCHANGE"));
     $event->setLine(1, self::getTranslation("ITEM_FROM", $shopData["from"]["name"]));
     $event->setLine(2, self::getTranslation("ITEM_TO", $shopData["to"]["name"]));
     $event->setLine(3, $shopData["desc"]);
 }
Beispiel #16
0
 public function onSignChange(SignChangeEvent $event)
 {
     $tag = $event->getLine(0);
     if (($val = $this->checkTag($tag)) !== false) {
         $player = $event->getPlayer();
         if (!$player->hasPermission("economysell.sell.create")) {
             $player->sendMessage($this->getMessage("no-permission-create"));
             return;
         }
         if (!is_numeric($event->getLine(1)) or !is_numeric($event->getLine(3))) {
             $player->sendMessage($this->getMessage("wrong-format"));
             return;
         }
         $item = $this->getItem($event->getLine(2));
         if ($item === false) {
             $player->sendMessage($this->getMessage("item-not-support", array($event->getLine(2), "", "")));
             return;
         }
         if ($item[1] === false) {
             // Item name found
             $id = explode(":", strtolower($event->getLine(2)));
             $event->setLine(2, $item[0]);
         } else {
             //$tmp = $this->getItem(strtolower($event->getLine(2)));
             $id = explode(":", $item[0]);
         }
         $id[0] = (int) $id[0];
         if (!isset($id[1])) {
             $id[1] = 0;
         }
         $itemName = $item[1] === false ? $item[0] : $event->getLine(2);
         $block = $event->getBlock();
         $this->sell[$block->getX() . ":" . $block->getY() . ":" . $block->getZ() . ":" . $player->getLevel()->getName()] = array("x" => $block->getX(), "y" => $block->getY(), "z" => $block->getZ(), "level" => $player->getLevel()->getName(), "cost" => (int) $event->getLine(1), "item" => (int) $id[0], "itemName" => $event->getLine(2), "meta" => (int) $id[1], "amount" => (int) $event->getLine(3));
         $player->sendMessage($this->getMessage("sell-created", [$itemName, (int) $event->getLine(3), ""]));
         $mu = EconomyAPI::getInstance()->getMonetaryUnit();
         $event->setLine(0, $val[0]);
         $event->setLine(1, str_replace(["%MONETARY_UNIT%", "%1"], [$mu, $event->getLine(1)], $val[1]));
         $event->setLine(2, str_replace(["%MONETARY_UNIT%", "%2"], [$mu, $event->getLine(2)], $itemName));
         $event->setLine(3, str_replace(["%MONETARY_UNIT%", "%3"], [$mu, $event->getLine(3)], $val[3]));
     }
 }
Beispiel #17
0
 public function placeSign(SignChangeEvent $ev)
 {
     if ($ev->getBlock()->getId() != Block::SIGN_POST && $ev->getBlock()->getId() != Block::WALL_SIGN) {
         return;
     }
     $sign = $ev->getPlayer()->getLevel()->getTile($ev->getBlock());
     if (!$sign instanceof Sign) {
         return;
     }
     $sign = $ev->getLines();
     if (!isset($this->texts[$sign[0]])) {
         return;
     }
     if (!$this->validateSign($ev->getPlayer(), $sign)) {
         $ev->setLine(0, "[BROKEN]");
         return;
     }
     $ev->getPlayer()->sendMessage(mc::_("[GoldStd] placed sign"));
 }
Beispiel #18
0
 public function onSignChange(SignChangeEvent $event)
 {
     if (!$event->getPlayer()->hasPermission("potiondispenser.create")) {
         return;
     }
     $text = $event->getLines();
     $prefix = strtoupper($text[0]);
     if ($prefix !== "[DISPENSER]" && $prefix !== "[POTION SHOP]") {
         return;
     }
     $effect = explode(':', $text[1] . $text[2]);
     if (count($effect) < 1) {
         return;
     }
     if ($effect[0] === "clear") {
         $this->registerDispenser(array("name" => "clear", "cost" => (int) $text[3]), $event->getBlock(), $event->getPlayer());
         $event->setLine(0, $this->getTranslation("DISPENSER"));
         $event->setLine(1, TextFormat::GOLD . $this->getTranslation("POTION_NAME_NO_LEV", $this->getTranslation("CLEAR")));
         $event->setLine(2, "");
         $event->setLine(3, $this->getTranslation("DISPENSER_COST", (int) $text[3] . EconomyAPI::getInstance()->getMonetaryUnit()));
         return;
     } elseif (count($effect) < 2) {
         return;
     }
     $effectInstance = Effect::getEffectByName($effect[0]);
     if ($effectInstance === null) {
         $effectInstance = Effect::getEffect($effect[0]);
         if ($effectInstance === null) {
             return;
         }
     }
     $effectId = $effectInstance->getId();
     $amplifier = (int) $effect[1];
     if ($effectInstance instanceof InstantEffect) {
         $duration = 1;
     } else {
         if (count($effect) < 3) {
             return;
         }
         $duration = (int) $effect[2] * 20;
     }
     $this->registerDispenser(array("name" => $effectId, "amplifier" => $amplifier, "duration" => $duration, "cost" => $text[3]), $event->getBlock(), $event->getPlayer());
     $event->setLine(0, $this->getTranslation("DISPENSER"));
     $color = $effectInstance->isBad() ? TextFormat::RED : TextFormat::AQUA;
     $event->setLine(1, $color . $this->getTranslation("POTION_NAME", $this->getServer()->getLanguage()->translate(new TextContainer($effectInstance->getName())), $amplifier + 1));
     if ($effectInstance instanceof InstantEffect) {
         $event->setLine(2, "");
     } else {
         $event->setLine(2, $this->getTranslation("DURATION", (int) $effect[2]));
     }
     $price = (int) $text[3] . EconomyAPI::getInstance()->getMonetaryUnit();
     $event->setLine(3, $this->getTranslation("DISPENSER_COST", $price));
 }
Beispiel #19
0
 public function Update(SignChangeEvent $event)
 {
     //Thanks TahaTheHacker!
     $line1 = $event->getLine(0);
     $line2 = $event->getLine(1);
     $line3 = $event->getLine(2);
     $line4 = $event->getLine(3);
     if ($line1 == strtolower("[parkour]")) {
         if (isset($this->course[$line2])) {
             $event->setLine(0, "§l§a[§bParkour§a]");
             $event->setLine(1, "§l§a" . $line2);
             $event->setLine(2, "§l§a" . $line3);
             $event->setLine(3, "§l§a" . $line4);
         } else {
             $event->getPlayer()->sendMessage("[error] The Course doesn't exist. ");
             $event->setLine(0, "§l§c[§bError§c]");
             $event->setLine(1, "§l§c[§bError§c]");
             $event->setLine(2, "§l§c[§bError§c]");
             $event->setLine(3, "§l§c[§bError§c]");
         }
     }
 }
Beispiel #20
0
 /**
  * @param SignChangeEvent $event
  */
 public function onSignChange(SignChangeEvent $event)
 {
     // Special Signs
     // Free sign
     if (strtolower(TextFormat::clean($event->getLine(0), true)) === "[free]" && $event->getPlayer()->hasPermission("essentials.sign.create.free")) {
         if (trim($event->getLine(1)) !== "" || $event->getLine(1) !== null) {
             $item_name = $event->getLine(1);
             if (trim($event->getLine(2)) !== "" || $event->getLine(2) !== null) {
                 $damage = $event->getLine(2);
             } else {
                 $damage = 0;
             }
             $item = $this->getAPI()->getItem($item_name . ":" . $damage);
             if ($item->getID() === 0 || $item->getName() === "Air") {
                 $event->getPlayer()->sendMessage(TextFormat::RED . "[Error] Invalid item name/ID");
                 $event->setCancelled(true);
             } else {
                 $event->getPlayer()->sendMessage(TextFormat::GREEN . "Free sign successfully created!");
                 $event->setLine(0, TextFormat::AQUA . "[Free]");
                 $event->setLine(1, $item->getName() === "Unknown" ? $item->getID() : $item->getName());
                 $event->setLine(2, $damage);
             }
         } else {
             $event->getPlayer()->sendMessage(TextFormat::RED . "[Error] You should provide an item name/ID");
             $event->setCancelled(true);
         }
     } elseif (strtolower(TextFormat::clean($event->getLine(0), true)) === "[gamemode]" && $event->getPlayer()->hasPermission("essentials.sign.create.gamemode")) {
         switch (strtolower($event->getLine(1))) {
             case "survival":
             case "0":
                 $event->setLine(1, "Survival");
                 break;
             case "creative":
             case "1":
                 $event->setLine(1, "Creative");
                 break;
             case "adventure":
             case "2":
                 $event->setLine(1, "Adventure");
                 break;
             case "spectator":
             case "view":
             case "3":
                 $event->setLine(1, "Spectator");
                 break;
             default:
                 $event->getPlayer()->sendMessage(TextFormat::RED . "[Error] Unknown Gamemode, you should use \"Survival\", \"Creative\", \"Adventure\" or \"Spectator\"");
                 $event->setCancelled(true);
                 return;
                 break;
         }
         $event->getPlayer()->sendMessage(TextFormat::GREEN . "Gamemode sign successfully created!");
         $event->setLine(0, TextFormat::AQUA . "[Gamemode]");
     } elseif (strtolower(TextFormat::clean($event->getLine(0), true)) === "[heal]" && $event->getPlayer()->hasPermission("essentials.sign.create.heal")) {
         $event->getPlayer()->sendMessage(TextFormat::GREEN . "Heal sign successfully created!");
         $event->setLine(0, TextFormat::AQUA . "[Heal]");
     } elseif (strtolower(TextFormat::clean($event->getLine(0), true)) === "[kit]" && $event->getPlayer()->hasPermission("essentials.sign.create.kit")) {
         if (!$this->getAPI()->kitExists($event->getLine(1))) {
             $event->getPlayer()->sendMessage(TextFormat::RED . "[Error] Kit doesn't exist");
             return;
         }
         $event->getPlayer()->sendMessage(TextFormat::GREEN . "Kit sign successfully created!");
         $event->setLine(0, TextFormat::AQUA . "[Kit]");
     } elseif (strtolower(TextFormat::clean($event->getLine(0), true)) === "[repair]" && $event->getPlayer()->hasPermission("essentials.sign.create.repair")) {
         switch (strtolower($event->getLine(1))) {
             case "hand":
                 $event->setLine(1, "Hand");
                 break;
             case "all":
                 $event->setLine(1, "All");
                 break;
             default:
                 $event->getPlayer()->sendMessage(TextFormat::RED . "[Error] Invalid argument, you should use \"Hand\" or \"All\"");
                 $event->setCancelled(true);
                 return;
                 break;
         }
         $event->getPlayer()->sendMessage(TextFormat::GREEN . "Repair sign successfully created!");
         $event->setLine(0, TextFormat::AQUA . "[Repair]");
     } elseif (strtolower(TextFormat::clean($event->getLine(0), true)) === "[time]" && $event->getPlayer()->hasPermission("essentials.sign.create.time")) {
         switch (strtolower($event->getLine(1))) {
             case "day":
                 $event->setLine(1, "Day");
                 break;
             case "night":
                 $event->setLine(1, "Night");
                 break;
             default:
                 $event->getPlayer()->sendMessage(TextFormat::RED . "[Error] Invalid time, you should use \"Day\" or \"Night\"");
                 $event->setCancelled(true);
                 return;
                 break;
         }
         $event->getPlayer()->sendMessage(TextFormat::GREEN . "Time sign successfully created!");
         $event->setLine(0, TextFormat::AQUA . "[Time]");
     } elseif (strtolower(TextFormat::clean($event->getLine(0), true)) === "[teleport]" && $event->getPlayer()->hasPermission("essentials.sign.create.teleport")) {
         if (!is_numeric($event->getLine(1))) {
             $event->getPlayer()->sendMessage(TextFormat::RED . "[Error] Invalid X position, Teleport sign will not work");
             $event->setCancelled(true);
         } elseif (!is_numeric($event->getLine(2))) {
             $event->getPlayer()->sendMessage(TextFormat::RED . "[Error] Invalid Y position, Teleport sign will not work");
             $event->setCancelled(true);
         } elseif (!is_numeric($event->getLine(3))) {
             $event->getPlayer()->sendMessage(TextFormat::RED . "[Error] Invalid Z position, Teleport sign will not work");
             $event->setCancelled(true);
         } else {
             $event->getPlayer()->sendMessage(TextFormat::GREEN . "Teleport sign successfully created!");
             $event->setLine(0, TextFormat::AQUA . "[Teleport]");
             $event->setLine(1, $event->getLine(1));
             $event->setLine(2, $event->getLine(2));
             $event->setLine(3, $event->getLine(3));
         }
     } elseif (strtolower(TextFormat::clean($event->getLine(0), true)) === "[warp]" && $event->getPlayer()->hasPermission("essentials.sign.create.warp")) {
         $warp = $event->getLine(1);
         if (!$this->getAPI()->warpExists($warp)) {
             $event->getPlayer()->sendMessage(TextFormat::RED . "[Error] Warp doesn't exists");
             $event->setCancelled(true);
         } else {
             $event->getPlayer()->sendMessage(TextFormat::GREEN . "Warp sign successfully created!");
             $event->setLine(0, TextFormat::AQUA . "[Warp]");
         }
     } elseif ($event->getPlayer()->hasPermission("essentials.sign.color")) {
         for ($i = 0; $i < 4; $i++) {
             $event->setLine($i, $this->getAPI()->colorMessage($event->getLine($i)));
         }
     }
 }
Beispiel #21
0
 /** Stuff for next update once SignChangeEvent is implemented */
 public function tileupdate(SignChangeEvent $event)
 {
     if ($event->getBlock()->getID() == 323 || $event->getBlock()->getID() == 63 || $event->getBlock()->getID() == 68) {
         //Server::getInstance()->broadcastMessage("lv1");
         $sign = $event->getPlayer()->getLevel()->getTile($event->getBlock());
         if (!$sign instanceof Sign) {
             return true;
         }
         $sign = $event->getLines();
         if ($sign[0] == '[WORLD]') {
             //Server::getInstance()->broadcastMessage("lv2");
             if ($event->getPlayer()->isOp()) {
                 //Server::getInstance()->broadcastMessage("lv3");
                 if (empty($sign[1]) !== true) {
                     //Server::getInstance()->broadcastMessage("lv4");
                     if (Server::getInstance()->loadLevel($sign[1]) !== false) {
                         //Server::getInstance()->broadcastMessage("lv5");
                         $event->getPlayer()->sendMessage("[SignPortal] Portal to world '" . $sign[1] . "' created");
                         return true;
                     }
                     $event->getPlayer()->sendMessage("[SignPortal] World '" . $sign[1] . "' does not exist!");
                     //Server::getInstance()->broadcastMessage("f4");
                     $event->setLine(0, "[BROKEN]");
                     return false;
                 }
                 $event->getPlayer()->sendMessage("[SignPortal] World name not set");
                 //Server::getInstance()->broadcastMessage("f3");
                 $event->setLine(0, "[BROKEN]");
                 return false;
             }
             $event->getPlayer()->sendMessage("[SignPortal] You must be an OP to make a portal");
             //Server::getInstance()->broadcastMessage("f2");
             $event->setLine(0, "[BROKEN]");
             return false;
         }
     }
     return true;
 }
 /**
  * @param SignChangeEvent $event
  */
 public function onSignChange(SignChangeEvent $event)
 {
     $player = $event->getPlayer();
     if (strtolower(trim($event->getLine(0))) == "status" || strtolower(trim($event->getLine(0))) == "[status]") {
         if ($player->hasPermission("signstatus") or $player->hasPermission("signstatus.create")) {
             $tps = $this->getServer()->getTicksPerSecond();
             $p = count($this->getServer()->getOnlinePlayers());
             $level = $event->getBlock()->getLevel()->getName();
             $full = $this->getServer()->getMaxPlayers();
             $load = $this->getServer()->getTickUsage();
             $format = $this->format->getAll();
             for ($x = 0; $x <= 3; $x++) {
                 $v = $format["format"][$x + 1];
                 $v = str_replace("{ONLINE}", $p, $v);
                 $v = str_replace("{MAX_ONLINE}", $full, $v);
                 $v = str_replace("{WORLD_NAME}", $level, $v);
                 $v = str_replace("{TPS}", $tps, $v);
                 $v = str_replace("{SERVER_LOAD}", $load, $v);
                 $event->setLine($x, $v);
             }
             //$event->setText(F::GREEN."[STATUS]",F::YELLOW."TPS: [$tps]",F::AQUA."ONLINE: ".F::GREEN.$p.F::WHITE."/".F::RED.$full.",".F::GOLD."******");
             $event->getPlayer()->sendMessage($this->prefix . $this->translation->get("sign_created"));
         } else {
             $player->sendMessage($this->prefix . $this->translation->get("sign_no_perms"));
             $event->setCancelled();
         }
     }
 }
Beispiel #23
0
 public function onSignPlace(SignChangeEvent $event)
 {
     if (!$event->getPlayer()->isOp()) {
         return;
     }
     if ($event->getLine(0) != $this->get("tutorial")) {
         return;
     }
     switch (strtolower($event->getLine(1))) {
         case $this->get("start"):
             $event->setLine(0, TextFormat::WHITE . $this->get("sign-tutorial-start1"));
             $event->setLine(1, TextFormat::WHITE . $this->get("sign-tutorial-start2"));
             $event->setLine(2, TextFormat::WHITE . $this->get("sign-tutorial-start3"));
             $this->setStartSign($event->getBlock());
             break;
         case $this->get("skip"):
             $event->setLine(0, TextFormat::WHITE . $this->get("sign-tutorial-skip1"));
             $event->setLine(1, TextFormat::WHITE . $this->get("sign-tutorial-skip2"));
             $event->setLine(2, TextFormat::WHITE . $this->get("sign-tutorial-skip3"));
             $this->setSkipSign($event->getBlock());
             break;
         case $this->get("restart"):
             $event->setLine(0, TextFormat::WHITE . $this->get("sign-tutorial-restart1"));
             $event->setLine(1, TextFormat::WHITE . $this->get("sign-tutorial-restart2"));
             $event->setLine(2, TextFormat::WHITE . $this->get("sign-tutorial-restart3"));
             $this->setRestartSign($event->getBlock());
             break;
         case $this->get("mine"):
             $event->setLine(0, TextFormat::WHITE . $this->get("sign-tutorial-pass1"));
             $event->setLine(1, TextFormat::WHITE . $this->get("sign-tutorial-pass2"));
             $event->setLine(2, TextFormat::WHITE . $this->get("sign-tutorial-pass3"));
             $this->setMine($event->getBlock(), $event->getPlayer()->getPosition());
             break;
         case $this->get("shop"):
             $event->setLine(0, TextFormat::WHITE . $this->get("sign-tutorial-pass1"));
             $event->setLine(1, TextFormat::WHITE . $this->get("sign-tutorial-pass2"));
             $event->setLine(2, TextFormat::WHITE . $this->get("sign-tutorial-pass3"));
             $this->setShop($event->getBlock(), $event->getPlayer()->getPosition());
             break;
         case $this->get("notice"):
             $event->setLine(0, TextFormat::WHITE . $this->get("sign-tutorial-pass1"));
             $event->setLine(1, TextFormat::WHITE . $this->get("sign-tutorial-pass2"));
             $event->setLine(2, TextFormat::WHITE . $this->get("sign-tutorial-pass3"));
             $this->setNotice($event->getBlock(), $event->getPlayer()->getPosition());
             break;
         case $this->get("wild"):
             $event->setLine(0, TextFormat::WHITE . $this->get("sign-tutorial-pass1"));
             $event->setLine(1, TextFormat::WHITE . $this->get("sign-tutorial-pass2"));
             $event->setLine(2, TextFormat::WHITE . $this->get("sign-tutorial-pass3"));
             $this->setWild($event->getBlock(), $event->getPlayer()->getPosition());
             break;
         default:
             $this->message($event->getPlayer(), $this->get("help-signset"));
             break;
     }
 }
Beispiel #24
0
 public function onSignChange(SignChangeEvent $event)
 {
     $result = $this->tagExists($event->getLine(0));
     if ($result !== false) {
         $player = $event->getPlayer();
         if (!$player->hasPermission("economyshop.shop.create")) {
             $player->sendMessage($this->getMessage("no-permission-create"));
             return;
         }
         if (!is_numeric($event->getLine(1)) or !is_numeric($event->getLine(3))) {
             $player->sendMessage($this->getMessage("wrong-format"));
             return;
         }
         // Item identify
         $item = $this->getItem($event->getLine(2));
         if ($item === false) {
             $player->sendMessage($this->getMessage("item-not-support", array($event->getLine(2), "", "")));
             return;
         }
         if ($item[1] === false) {
             // Item name found
             $id = explode(":", strtolower($event->getLine(2)));
             $event->setLine(2, $item[0]);
         } else {
             $tmp = $this->getItem(strtolower($event->getLine(2)));
             $id = explode(":", $tmp[0]);
         }
         $id[0] = (int) $id[0];
         if (!isset($id[1])) {
             $id[1] = 0;
         }
         // Item identify end
         $block = $event->getBlock();
         $this->shop[$block->getX() . ":" . $block->getY() . ":" . $block->getZ() . ":" . $block->getLevel()->getFolderName()] = array("x" => $block->getX(), "y" => $block->getY(), "z" => $block->getZ(), "level" => $block->getLevel()->getFolderName(), "price" => (int) $event->getLine(1), "item" => (int) $id[0], "itemName" => $event->getLine(2), "meta" => (int) $id[1], "amount" => (int) $event->getLine(3));
         $player->sendMessage($this->getMessage("shop-created", array($id[0], $id[1], $event->getLine(1))));
         $event->setLine(0, $result[0]);
         // TAG
         $event->setLine(1, str_replace("%1", $event->getLine(1), $result[1]));
         // PRICE
         $event->setLine(2, str_replace("%2", $event->getLine(2), $result[2]));
         // ITEM NAME
         $event->setLine(3, str_replace("%3", $event->getLine(3), $result[3]));
         // AMOUNT
     }
 }
Beispiel #25
0
 public function onSignChange(SignChangeEvent $event)
 {
     $line = $event->getLines();
     if (($val = $this->getTag($line[0])) !== false) {
         $player = $event->getPlayer();
         if (!$player->hasPermission("economypshop.shop.create")) {
             $player->sendMessage($this->getMessage("no-permission-create-shop"));
             return;
         }
         $money = EconomyAPI::getInstance()->myMoney($player->getName());
         if ($money < $this->getConfig()->get("shop-tax")) {
             $player->sendMessage($this->getMessage("no-shop-tax"));
             return;
         }
         EconomyAPI::getInstance()->reduceMoney($player->getName(), $this->getConfig()->get("shop-tax"), "EconomyPShop");
         $cost = $line[1];
         $item = $line[2];
         $amount = $line[3];
         if (!is_numeric($cost) or !is_numeric($amount)) {
             $player->sendMessage($this->getMessage("insert-right-format"));
             return;
         }
         // Item identify
         $item = $this->getItem($line[2]);
         if ($item === false) {
             $player->sendMessage($this->getMessage("item-not-support", array($line[2], "", "")));
             return;
         }
         if ($item[1] === false) {
             // Item name found
             $id = explode(":", strtolower($line[2]));
             $line[2] = $item[0];
         } else {
             $tmp = $this->getItem(strtolower($line[2]));
             $id = explode(":", $tmp[0]);
         }
         $id[0] = (int) $id[0];
         if (!isset($id[1])) {
             $id[1] = 0;
         }
         // Item identify end
         $block = $event->getBlock();
         $this->shop[$block->getX() . ":" . $block->getY() . ":" . $block->getZ() . ":" . $block->getLevel()->getFolderName()] = ["x" => $block->getX(), "y" => $block->getY(), "z" => $block->getZ(), "level" => $block->getLevel()->getFolderName(), "owner" => $player->getName(), "price" => (int) $line[1], "item" => (int) $id[0], "itemName" => $line[2], "meta" => (int) $id[1], "amount" => (int) $line[3]];
         $mu = EconomyAPI::getInstance()->getMonetaryUnit();
         $event->setLine(0, str_replace("%MONETARY_UNIT%", $mu, $val[0]));
         $event->setLine(1, str_replace(["%MONETARY_UNIT%", "%1"], [$mu, $cost], $val[1]));
         $event->setLine(2, str_replace(["%MONETARY_UNIT%", "%2"], [$mu, $line[2]], $val[2]));
         $event->setLine(3, str_replace(["%MONETARY_UNIT%", "%3"], [$mu, $amount], $val[3]));
         $player->sendMessage($this->getMessage("shop-created", [$line[2], $cost, $amount]));
     }
 }
Beispiel #26
0
 public function onSignChange(SignChangeEvent $event)
 {
     $line = $event->getLines();
     if (($val = $this->getTag($line[0])) !== false) {
         $player = $event->getPlayer();
         if (!$player->hasPermission("economypshop.shop.create")) {
             $player->sendMessage($this->getMessage("no-permission-create-shop"));
             return;
         }
         $money = \onebone\economyapi\EconomyAPI::getInstance()->myMoney($player->getName());
         if ($money < $this->getConfig()->get("shop-tax")) {
             $player->sendMessage($this->getMessage("no-shop-tax"));
             return;
         }
         \onebone\economyapi\EconomyAPI::getInstance()->reduceMoney($player->getName(), $this->getConfig()->get("shop-tax"), "EconomyPShop");
         $cost = $line[1];
         $item = $line[2];
         $amount = $line[3];
         if (!is_numeric($cost) or !is_numeric($amount)) {
             $player->sendMessage($this->getMessage("insert-right-format"));
             return;
         }
         if ($cost < 0 or $amount < 1 or (int) $amount != $amount) {
             $player->sendMessage($this->getMessage("wrong-num"));
             return;
         }
         $item = Item::fromString($line[2]);
         if (!$item instanceof Item) {
             $player->sendMessage($this->getMessage("item-not-support", array($line[2], "", "")));
             return;
         }
         $block = $event->getBlock();
         $this->shop[$block->getX() . ":" . $block->getY() . ":" . $block->getZ() . ":" . $block->getLevel()->getFolderName()] = ["x" => $block->getX(), "y" => $block->getY(), "z" => $block->getZ(), "level" => $block->getLevel()->getFolderName(), "owner" => $player->getName(), "price" => (int) $line[1], "item" => (int) $item->getID(), "itemName" => $line[2], "meta" => (int) $item->getDamage(), "amount" => (int) $line[3]];
         $mu = \onebone\economyapi\EconomyAPI::getInstance()->getMonetaryUnit();
         $event->setLine(0, str_replace("%MONETARY_UNIT%", $mu, $val[0]));
         $event->setLine(1, str_replace(["%MONETARY_UNIT%", "%1"], [$mu, $cost], $val[1]));
         $event->setLine(2, str_replace(["%MONETARY_UNIT%", "%2"], [$mu, $item->getName()], $val[2]));
         $event->setLine(3, str_replace(["%MONETARY_UNIT%", "%3"], [$mu, $amount], $val[3]));
         $player->sendMessage($this->getMessage("shop-created", [$item->getName(), $cost, $amount]));
     }
 }
Beispiel #27
0
 public function onSignChange(SignChangeEvent $event)
 {
     $text = $event->getLines();
     $prefix = strtoupper($text[0]);
     if ($prefix !== "[ARUSHOP]") {
         return;
     }
     if (!$event->getPlayer()->hasPermission("arushop.create")) {
         $event->getPlayer()->sendMessage(TextFormat::RED . ToAruPG::getTranslation("NO_PERMISSION"));
         return;
     }
     $cost = $text[2];
     $meta = $text[3];
     $tag = $event->getBlock()->getX() . ";" . $event->getBlock()->getY() . ";" . $event->getBlock()->getZ() . ";" . $event->getBlock()->getLevel()->getFolderName();
     if (!is_numeric($cost) || !is_numeric($meta)) {
         $event->getPlayer()->sendMessage(TextFormat::RED . ToAruPG::getTranslation("WRONG_SHOP_META"));
         return;
     }
     switch (strtoupper($text[1])) {
         case "JOB":
             if (JobManager::getJob($meta) === null) {
                 $event->getPlayer()->sendMessage(TextFormat::RED . ToAruPG::getTranslation("WRONG_SHOP_META"));
                 return;
             }
             $this->shops[$tag] = new JobShop($meta, $cost, ToAruPG::getTranslation("TAP_ONE_MORE"));
             $meta = ToAruPG::getTranslation(JobManager::getJob($meta)->getName());
             $name = ToAruPG::getTranslation("JOB_SHOP");
             break;
         case "SKILL":
             if (SkillManager::getSkill($meta) === null) {
                 $event->getPlayer()->sendMessage(TextFormat::RED . ToAruPG::getTranslation("WRONG_SHOP_META"));
                 return;
             }
             $this->shops[$tag] = new SkillShop($meta, $cost, ToAruPG::getTranslation("TAP_ONE_MORE"));
             $meta = ToAruPG::getTranslation(SkillManager::getSkill($meta)->getName());
             $name = ToAruPG::getTranslation("SKILL_SHOP");
             break;
         case "SET":
             if (JobManager::getJob($meta) === null) {
                 $event->getPlayer()->sendMessage(TextFormat::RED . ToAruPG::getTranslation("WRONG_SHOP_META"));
                 return;
             }
             $this->shops[$tag] = new SetShop($meta, $cost, ToAruPG::getTranslation("TAP_ONE_MORE"));
             $meta = ToAruPG::getTranslation(JobManager::getJob($meta)->getName());
             $name = ToAruPG::getTranslation("SET_SHOP");
             break;
         default:
             $event->getPlayer()->sendMessage(TextFormat::RED . ToAruPG::getTranslation("WRONG_SHOP_META"));
             return;
     }
     $this->saveShops();
     $event->setLine(0, $name);
     $event->setLine(1, TextFormat::AQUA . $meta);
     $event->setLine(2, $cost . EconomyAPI::getInstance()->getMonetaryUnit());
     $event->setLine(3, "");
     $event->getPlayer()->sendMessage(TextFormat::AQUA . ToAruPG::getTranslation("SHOP_CREATED"));
 }
 /**
  * @param SignChangeEvent $event
  */
 public function onSignChange(SignChangeEvent $event)
 {
     $player = $event->getPlayer();
     if (strtolower(trim($event->getLine(0))) == "status" || strtolower(trim($event->getLine(0))) == "[狀態]") {
         if ($player->hasPermission("signstatus")) {
             $tps = $this->getServer()->getTicksPerSecond();
             $p = count($this->getServer()->getOnlinePlayers());
             $level = $event->getBlock()->getLevel()->getName();
             $full = $this->getServer()->getMaxPlayers();
             $event->setLine(0, F::GREEN . "[狀態]");
             $event->setLine(1, F::YELLOW . "TPS: [" . $tps . "]");
             $event->setLine(2, F::AQUA . "在線: " . F::GREEN . $p . F::WHITE . "/" . F::RED . $full . "");
             $event->setLine(3, F::GOLD . "******");
             $this->sign->setNested("sign.x", $event->getBlock()->getX());
             $this->sign->setNested("sign.y", $event->getBlock()->getY());
             $this->sign->setNested("sign.z", $event->getBlock()->getZ());
             $this->sign->setNested("sign.enabled", true);
             $this->sign->setNested("sign.level", $level);
             $this->sign->save();
             $this->sign->reload();
             $event->getPlayer()->sendMessage($this->prefix . $this->translation->get("sign_created"));
         } else {
             $player->sendMessage($this->prefix . $this->translation->get("sign_no_perms"));
             $event->setCancelled();
         }
     }
 }
Beispiel #29
0
 public function onSignChange(SignChangeEvent $event)
 {
     if (strToLower($event->getLine(0)) !== strToLower(self::tag)) {
         return;
     }
     if ($event->getPlayer()->isOp() === false) {
         $event->getPlayer()->sendMessage(TextFormat::DARK_RED . self::tag . " You don't have permission to create a shop!");
         $event->setCancelled(true);
         return;
     }
     $key = $this->getAxisKey($event->getBlock(), self::axisToken);
     if (isset($this->shops[$key])) {
         $event->getPlayer()->sendMessage(TextFormat::DARK_RED . self::tag . " Cannot create shop - Here are already shop exists!");
         $event->setCancelled(true);
         return;
     }
     $event->setLine(0, self::tag);
     $event->setLine(1, "");
     $event->setLine(2, "");
     $event->setLine(3, "");
     $this->shops[$key] = $event->getPlayer()->getName();
     $event->getPlayer()->sendMessage(TextFormat::DARK_AQUA . self::tag . " Shop created!");
 }