public function onPlayerAchievementAwardedEvent(PlayerAchievementAwardedEvent $event)
 {
     $message = new TranslationContainer("chat.type.achievement", [$event->getPlayer()->getDisplayName(), TextFormat::GREEN . Achievement::$list[$event->getAchievement()]["name"]]);
     if ($message instanceof TranslationContainer) {
         $message = $this->getServer()->getLanguage()->translateString($message->getText(), $message->getParameters());
     }
     AnnounceSystem::getInstance()->pushBroadCastPopup($message, 2);
 }
Esempio n. 2
0
 public function PlayerAchievementAwardedEvent(PlayerAchievementAwardedEvent $event)
 {
     $player = $event->getPlayer();
     $achievement = $event->getAchievement();
     if ($this->config->get("PlayerAchievementAwardedEvent", true)) {
         if ($player instanceof Player) {
             $event->setCancelled(true);
             $player->sendTip($this->prefix . "§5§lYou have {$achievement} awarded!");
             $player->getLevel()->addSound(new PopSound($player));
         }
     }
 }