mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-20 16:00:20 +00:00
relocate comments
This commit is contained in:
parent
81ca0c8fbf
commit
d2eddf9d33
@ -933,9 +933,9 @@ class NetworkSession{
|
||||
|
||||
public function onChatMessage(Translatable|string $message) : void{
|
||||
if($message instanceof Translatable){
|
||||
//we can't send nested translations to the client, so make sure they are always pre-translated by the server
|
||||
$language = $this->player->getLanguage();
|
||||
if(!$this->server->isLanguageForced()){
|
||||
//we can't send nested translations to the client, so make sure they are always pre-translated by the server
|
||||
$parameters = array_map(fn(string|Translatable $p) => $p instanceof Translatable ? $language->translate($p) : $p, $message->getParameters());
|
||||
$this->sendDataPacket(TextPacket::translation($language->translateString($message->getText(), $parameters, "pocketmine."), $parameters));
|
||||
}else{
|
||||
|
@ -52,9 +52,9 @@ class DeathPacketHandler extends PacketHandler{
|
||||
/** @var string[] $parameters */
|
||||
$parameters = [];
|
||||
if($this->deathMessage instanceof Translatable){
|
||||
//we can't send nested translations to the client, so make sure they are always pre-translated by the server
|
||||
$language = $this->player->getLanguage();
|
||||
if(!$this->player->getServer()->isLanguageForced()){
|
||||
//we can't send nested translations to the client, so make sure they are always pre-translated by the server
|
||||
$parameters = array_map(fn(string|Translatable $p) => $p instanceof Translatable ? $language->translate($p) : $p, $this->deathMessage->getParameters());
|
||||
$message = $language->translateString($this->deathMessage->getText(), $parameters, "pocketmine.");
|
||||
}else{
|
||||
|
Loading…
x
Reference in New Issue
Block a user