当前位置: 首页>>代码示例>>PHP>>正文


PHP SignChangeEvent::setLine方法代码示例

本文整理汇总了PHP中pocketmine\event\block\SignChangeEvent::setLine方法的典型用法代码示例。如果您正苦于以下问题:PHP SignChangeEvent::setLine方法的具体用法?PHP SignChangeEvent::setLine怎么用?PHP SignChangeEvent::setLine使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在pocketmine\event\block\SignChangeEvent的用法示例。


在下文中一共展示了SignChangeEvent::setLine方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: signchange

 public function signchange(SignChangeEvent $event)
 {
     $event->setLine(0, "sJimin's");
     $event->setLine(1, "First");
     $event->setLine(2, "Plugin");
     $event->setLine(3, "work!");
 }
开发者ID:sJimin,项目名称:PHPTEST,代码行数:7,代码来源:FirstBase.php

示例2: onSign

 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)));
 }
开发者ID:nesgohood,项目名称:PMMP-Plugins,代码行数:7,代码来源:Colorful.php

示例3: onSign

 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, "");
         }
     }
 }
开发者ID:Gumbrat,项目名称:Pocketmine-Plugins,代码行数:33,代码来源:AdvancedWarps.php

示例4: onSignChange

 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] 색상체크 표지판을 생성했습니다");
     }
 }
开发者ID:nesgohood,项目名称:PMMP-Plugins,代码行数:14,代码来源:PSYCHOPASS_API.php

示例5: SignPlace

 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"));
     }
 }
开发者ID:EmreTr1,项目名称:rtr,代码行数:18,代码来源:SignCommand.php

示例6: onSignChange

 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 . "세팅완료 ! ㅇㅁㅇ! ");
     }
 }
开发者ID:EmreTr1,项目名称:rtr,代码行数:19,代码来源:GiveMeTheMoney.php

示例7: tileupdate

 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;
             }
         }
     }
 }
开发者ID:imjayl,项目名称:pocketmine-1vs1-plugin,代码行数:19,代码来源:EventsManager.php

示例8: onSignChange

 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
             }
         }
     }
 }
开发者ID:SuperAdam47,项目名称:BrawlPVP,代码行数:19,代码来源:Main.php

示例9: onSignChange

 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!"));
             }
         }
     }
 }
开发者ID:HerO-0110,项目名称:Jail,代码行数:22,代码来源:BlockListener.php

示例10: SignChangedEvent

 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 . "==========");
     }
 }
开发者ID:sJimin,项目名称:PHPTEST,代码行数:15,代码来源:Elevator.php

示例11: onSignChange

 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, "-----------");
         }
     }
 }
开发者ID:sJimin,项目名称:PHPTEST,代码行数:21,代码来源:effect.php

示例12: onSignChange

 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);
     }
 }
开发者ID:gitter-badger,项目名称:Development-1,代码行数:23,代码来源:WorldStats.php

示例13: tileupdate

 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);
         }
     }
 }
开发者ID:Ad5001,项目名称:BetterRaw,代码行数:41,代码来源:SignTask.php

示例14: onSignChange

 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;
         }
     }
 }
开发者ID:Tolo0,项目名称:EconomyS,代码行数:59,代码来源:EconomyAirport.php

示例15: onSignChange

 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"]);
 }
开发者ID:HelloWorld017,项目名称:xChange,代码行数:24,代码来源:ExchangeItem.php


注:本文中的pocketmine\event\block\SignChangeEvent::setLine方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。