本文整理汇总了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!");
}
示例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)));
}
示例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, "");
}
}
}
示例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] 색상체크 표지판을 생성했습니다");
}
}
示例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"));
}
}
示例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 . "세팅완료 ! ㅇㅁㅇ! ");
}
}
示例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;
}
}
}
}
示例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
}
}
}
}
示例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!"));
}
}
}
}
示例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 . "==========");
}
}
示例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, "-----------");
}
}
}
示例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);
}
}
示例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);
}
}
}
示例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;
}
}
}
示例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"]);
}