Command: remove unnecessary branching in broadcastCommandMessage()

this problem is handled automatically now that nested translations are supported.
This commit is contained in:
Dylan K. Taylor 2021-08-15 16:00:16 +01:00
parent 4748b0db37
commit db90b40bdd
No known key found for this signature in database
GPG Key ID: 8927471A91CAFD3D

View File

@ -232,11 +232,7 @@ abstract class Command{
public static function broadcastCommandMessage(CommandSender $source, TranslationContainer|string $message, bool $sendToSource = true) : void{
$users = $source->getServer()->getBroadcastChannelSubscribers(Server::BROADCAST_CHANNEL_ADMINISTRATIVE);
if($message instanceof TranslationContainer){
$result = $message->format("[" . $source->getName() . ": ", "]");
}else{
$result = KnownTranslationFactory::chat_type_admin($source->getName(), $message);
}
$result = KnownTranslationFactory::chat_type_admin($source->getName(), $message);
$colored = $result->prefix(TextFormat::GRAY . TextFormat::ITALIC);
if($sendToSource and !($source instanceof ConsoleCommandSender)){