Moved Player->setGamemode() message to /gamemode command

This commit is contained in:
Shoghi Cervantes 2015-04-15 20:49:38 +02:00
parent 88797d4c6c
commit d6186fa7c6
No known key found for this signature in database
GPG Key ID: 78464DB0A7837F89
2 changed files with 1 additions and 2 deletions

View File

@ -969,10 +969,8 @@ class Player extends Human implements CommandSender, InventoryHolder, IPlayer{
if(($this->gamemode & 0x01) === ($gm & 0x01)){ if(($this->gamemode & 0x01) === ($gm & 0x01)){
$this->gamemode = $gm; $this->gamemode = $gm;
$this->sendMessage(new TranslationContainer("gameMode.changed"));
}else{ }else{
$this->gamemode = $gm; $this->gamemode = $gm;
$this->sendMessage(new TranslationContainer("gameMode.changed"));
$this->inventory->clearAll(); $this->inventory->clearAll();
$this->inventory->sendContents($this); $this->inventory->sendContents($this);
$this->inventory->sendContents($this->getViewers()); $this->inventory->sendContents($this->getViewers());

View File

@ -79,6 +79,7 @@ class GamemodeCommand extends VanillaCommand{
if($target === $sender){ if($target === $sender){
Command::broadcastCommandMessage($sender, new TranslationContainer("commands.gamemode.success.self", [Server::getGamemodeString($gameMode)])); Command::broadcastCommandMessage($sender, new TranslationContainer("commands.gamemode.success.self", [Server::getGamemodeString($gameMode)]));
}else{ }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", [$target->getName(), Server::getGamemodeString($gameMode)]));
} }
} }