Improved /tell

This commit is contained in:
Dylan K. Taylor 2019-03-31 19:08:35 +01:00
parent c59a2d1b93
commit f0b85936cf
2 changed files with 6 additions and 3 deletions

@ -1 +1 @@
Subproject commit b8ec058c4cf341ff0c4f08f315feb990b62ae0e5
Subproject commit 15a2b7d4f05959376e3ef6d71e793b7bbdb2b60e

View File

@ -23,6 +23,7 @@ declare(strict_types=1);
namespace pocketmine\command\defaults;
use pocketmine\command\Command;
use pocketmine\command\CommandSender;
use pocketmine\command\utils\InvalidCommandSyntaxException;
use pocketmine\lang\TranslationContainer;
@ -61,9 +62,11 @@ class TellCommand extends VanillaCommand{
}
if($player instanceof Player){
$sender->sendMessage("[{$sender->getName()} -> {$player->getDisplayName()}] " . implode(" ", $args));
$message = implode(" ", $args);
$sender->sendMessage(new TranslationContainer(TextFormat::GRAY . TextFormat::ITALIC . "%commands.message.display.outgoing", [$player->getDisplayName(), $message]));
$name = $sender instanceof Player ? $sender->getDisplayName() : $sender->getName();
$player->sendMessage("[$name -> {$player->getName()}] " . implode(" ", $args));
$player->sendMessage(new TranslationContainer(TextFormat::GRAY . TextFormat::ITALIC . "%commands.message.display.incoming", [$name, $message]));
Command::broadcastCommandMessage($sender, new TranslationContainer("%commands.message.display.outgoing", [$player->getDisplayName(), $message]), false);
}else{
$sender->sendMessage(new TranslationContainer("commands.generic.player.notFound"));
}