Fix for incorrect gamemode messages, close #83 (#86)

Shows the correct message ingame but not in the console.
PocketMine doesn't handle the translation for gamemode changes, MCPE
does. No idea why but it requires the second and third parameter....

commands.gamemode.success.other=Set %2$s's game mode to %3$s
commands.gamemode.success.self=Set own game mode to %3$s

To solve the problem we have to change the language files and let
PocketMine-MP translate it.
This commit is contained in:
Intyre 2017-02-15 15:48:11 +01:00 committed by Dylan K. Taylor
parent 2d5567d9dd
commit 1908ed5812

View File

@ -77,10 +77,10 @@ class GamemodeCommand extends VanillaCommand{
$sender->sendMessage("Game mode change for " . $target->getName() . " failed!");
}else{
if($target === $sender){
Command::broadcastCommandMessage($sender, new TranslationContainer("commands.gamemode.success.self", [Server::getGamemodeString($gameMode)]));
Command::broadcastCommandMessage($sender, new TranslationContainer("commands.gamemode.success.self", ['blame', 'mojang', Server::getGamemodeString($gameMode)]));
}else{
$target->sendMessage(new TranslationContainer("gameMode.changed"));
Command::broadcastCommandMessage($sender, new TranslationContainer("commands.gamemode.success.other", [$target->getName(), Server::getGamemodeString($gameMode)]));
Command::broadcastCommandMessage($sender, new TranslationContainer("commands.gamemode.success.other", ['blame mojang', $target->getName(), Server::getGamemodeString($gameMode)]));
}
}