mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-07-11 04:17:48 +00:00
Command: remove unnecessary branching in broadcastCommandMessage()
this problem is handled automatically now that nested translations are supported.
This commit is contained in:
parent
4748b0db37
commit
db90b40bdd
@ -232,11 +232,7 @@ abstract class Command{
|
|||||||
|
|
||||||
public static function broadcastCommandMessage(CommandSender $source, TranslationContainer|string $message, bool $sendToSource = true) : void{
|
public static function broadcastCommandMessage(CommandSender $source, TranslationContainer|string $message, bool $sendToSource = true) : void{
|
||||||
$users = $source->getServer()->getBroadcastChannelSubscribers(Server::BROADCAST_CHANNEL_ADMINISTRATIVE);
|
$users = $source->getServer()->getBroadcastChannelSubscribers(Server::BROADCAST_CHANNEL_ADMINISTRATIVE);
|
||||||
if($message instanceof TranslationContainer){
|
$result = KnownTranslationFactory::chat_type_admin($source->getName(), $message);
|
||||||
$result = $message->format("[" . $source->getName() . ": ", "]");
|
|
||||||
}else{
|
|
||||||
$result = KnownTranslationFactory::chat_type_admin($source->getName(), $message);
|
|
||||||
}
|
|
||||||
$colored = $result->prefix(TextFormat::GRAY . TextFormat::ITALIC);
|
$colored = $result->prefix(TextFormat::GRAY . TextFormat::ITALIC);
|
||||||
|
|
||||||
if($sendToSource and !($source instanceof ConsoleCommandSender)){
|
if($sendToSource and !($source instanceof ConsoleCommandSender)){
|
||||||
|
Loading…
x
Reference in New Issue
Block a user