/**
  * @param CommandSender $sender
  * @param string $label
  * @param string[] $args
  * @return bool
  */
 public function execute(CommandSender $sender, $label, array $args)
 {
     if (!$this->testPermission($sender)) {
         return false;
     }
     if (isset($args[0])) {
         switch (strtolower($args[0])) {
             case "help":
                 $this->sendCommandHelp($sender);
                 return true;
             case "m":
             case "message":
                 if (isset($args[1])) {
                     $message = Utils::replaceSymbols(implode(" ", array_slice($args, 2)));
                     if (strtolower($args[1]) === "@all") {
                         $sender->getServer()->broadcastMessage($message);
                         $sender->sendMessage(TextFormat::GREEN . "Sent message to @all.");
                     } elseif ($player = $sender->getServer()->getPlayer($args[1])) {
                         $player->sendMessage($message);
                         $sender->sendMessage(TextFormat::GREEN . "Sent message to " . $player->getName() . ".");
                     } else {
                         $sender->sendMessage(TextFormat::RED . "Failed to send message due to invalid recipient(s).");
                     }
                 } else {
                     $sender->sendMessage(TextFormat::RED . "Please specify a recipient.");
                 }
                 return true;
             case "motd":
                 if (isset($args[1])) {
                     $motd = Utils::replaceSymbols(implode(" ", array_slice($args, 1)));
                     $sender->getServer()->getNetwork()->setName($motd);
                     $sender->sendMessage(TextFormat::GREEN . "Set server motd to: " . TextFormat::RESET . $motd . ".");
                 } else {
                     $sender->sendMessage(TextFormat::GREEN . "Current server motd: " . TextFormat::RESET . $sender->getServer()->getNetwork()->getName());
                 }
                 return true;
             case "p":
             case "popup":
                 if (isset($args[1])) {
                     $popup = Utils::replaceSymbols(implode(" ", array_slice($args, 2)));
                     if (strtolower($args[1]) === "@all") {
                         $this->plugin->broadcastPopup($popup);
                         $sender->sendMessage(TextFormat::GREEN . "Sent popup to @all.");
                     } elseif ($player = $sender->getServer()->getPlayer($args[1])) {
                         $player->sendPopup($popup);
                         $sender->sendMessage(TextFormat::GREEN . "Sent popup to " . $player->getName() . ".");
                     } else {
                         $sender->sendMessage(TextFormat::RED . "Failed to send message due to invalid recipient(s).");
                     }
                 } else {
                     $sender->sendMessage(TextFormat::RED . "Please specify a recipient.");
                 }
                 return true;
             case "t":
             case "tip":
                 if (isset($args[1])) {
                     $tip = Utils::replaceSymbols(implode(" ", array_slice($args, 2)));
                     if (strtolower($args[1]) === "@all") {
                         $this->plugin->broadcastTip($tip);
                         $sender->sendMessage(TextFormat::GREEN . "Sent tip to @all.");
                     } elseif ($player = $sender->getServer()->getPlayer($args[1])) {
                         $player->sendTip($tip);
                         $sender->sendMessage(TextFormat::GREEN . "Sent tip to " . $player->getName() . ".");
                     } else {
                         $sender->sendMessage(TextFormat::RED . "Failed to send message due to invalid recipient(s).");
                     }
                 } else {
                     $sender->sendMessage(TextFormat::RED . "Please specify a recipient.");
                 }
                 return true;
             default:
                 $sender->sendMessage("Usage: /easymessages <sub-command> [parameters]");
                 return false;
         }
     } else {
         $this->sendCommandHelp($sender);
         return false;
     }
 }
 /**
  * @param int $currentTick
  */
 public function onRun($currentTick)
 {
     $this->plugin->broadcastTip(Utils::getRandom($this->plugin->getConfig()->getNested("tip.autoMessages")));
 }
 /**
  * @param int $currentTick
  */
 public function onRun($currentTick)
 {
     $popup = $this->plugin->getScrollingPopup();
     $this->plugin->broadcastPopup($popup);
     $this->plugin->setScrollingPopup(Utils::next($popup));
 }
 /**
  * @param int $currentTick
  */
 public function onRun($currentTick)
 {
     $this->plugin->getServer()->broadcastMessage(Utils::getRandom($this->plugin->getConfig()->getNested("message.messages")));
 }
 /** 
  * @param PlayerChatEvent $event
  * @priority MONITOR
  */
 public function onPlayerChat(PlayerChatEvent $event)
 {
     if (!$this->plugin->getConfig()->getNested("color.colorChat") and !$event->getPlayer()->hasPermission("easymessages.action.color")) {
         $event->setMessage(Utils::replaceSymbols($event->getMessage(), true));
     }
 }
 /**
  * @param int $currentTick
  */
 public function onRun($currentTick)
 {
     $tip = $this->plugin->getScrollingTip();
     $this->plugin->broadcastTip($tip);
     $this->plugin->setScrollingTip(Utils::next($tip));
 }