Localized kick messages

This commit is contained in:
Shoghi Cervantes
2015-04-11 02:31:34 +02:00
parent c29ae333a2
commit de052a79de
3 changed files with 32 additions and 8 deletions

View File

@ -21,6 +21,7 @@
namespace pocketmine;
use pocketmine\event\TranslationContainer;
use pocketmine\utils\TextFormat;
/**
@ -106,10 +107,11 @@ abstract class Achievement{
public static function broadcast(Player $player, $achievementId){
if(isset(Achievement::$list[$achievementId])){
$translation = new TranslationContainer("chat.type.achievement", [$player->getDisplayName(), TextFormat::GREEN . Achievement::$list[$achievementId]["name"]]);
if(Server::getInstance()->getConfigString("announce-player-achievements", true) === true){
Server::getInstance()->broadcastMessage($player->getDisplayName() . " has just earned the achievement " . TextFormat::GREEN . Achievement::$list[$achievementId]["name"]);
Server::getInstance()->broadcastMessage($translation);
}else{
$player->sendMessage("You have just earned the achievement " . TextFormat::GREEN . Achievement::$list[$achievementId]["name"]);
$player->sendMessage($translation);
}
return true;