Command: Assume that TranslationContainer->getText() returns a valid translation key

there's no reason for it not to be.
This commit is contained in:
Dylan K. Taylor 2021-08-12 23:31:37 +01:00
parent 483c16cc41
commit d30371be11
No known key found for this signature in database
GPG Key ID: 8927471A91CAFD3D

View File

@ -234,7 +234,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){
$formatted = "[" . $source->getName() . ": " . ($source->getLanguage()->get($message->getText()) !== $message->getText() ? "%" : "") . $message->getText() . "]";
$formatted = "[" . $source->getName() . ": %" . $message->getText() . "]";
$result = new TranslationContainer($formatted, $message->getParameters());
$colored = new TranslationContainer(TextFormat::GRAY . TextFormat::ITALIC . $formatted, $message->getParameters());