Use Player::getDisplayName() on more commands

This commit is contained in:
Shoghi Cervantes 2014-07-14 14:12:03 +02:00
parent 096e238242
commit cb879977d2
2 changed files with 3 additions and 3 deletions

View File

@ -77,7 +77,7 @@ class SpawnpointCommand extends VanillaCommand{
if($sender instanceof Player){
$pos = new Position((int) $sender->x, (int) $sender->y, (int) $sender->z, $sender->getLevel());
$target->setSpawn($pos);
Command::broadcastCommandMessage($sender, "Set " . $target->getName() . "'s spawnpoint to " . $pos->x . ", " . $pos->y . ", " . $pos->z);
Command::broadcastCommandMessage($sender, "Set " . $target->getDisplayName() . "'s spawnpoint to " . $pos->x . ", " . $pos->y . ", " . $pos->z);
return true;
}else{

View File

@ -86,7 +86,7 @@ class TeleportCommand extends VanillaCommand{
if(count($args) < 3){
$pos = new Position($target->x, $target->y, $target->z, $target->getLevel());
$origin->teleport($pos);
Command::broadcastCommandMessage($sender, "Teleported " . $origin->getName() . " to " . $target->getName());
Command::broadcastCommandMessage($sender, "Teleported " . $origin->getDisplayName() . " to " . $target->getDisplayName());
return true;
}elseif($target->getLevel() !== null){
@ -95,7 +95,7 @@ class TeleportCommand extends VanillaCommand{
$y = $this->getRelativeDouble($target->y, $sender, $args[$pos++], 0, 128);
$z = $this->getRelativeDouble($target->z, $sender, $args[$pos]);
$target->teleport(new Vector3($x, $y, $z));
Command::broadcastCommandMessage($sender, "Teleported " . $target->getName() . " to " . round($x, 2) . ", " . round($y, 2) . ", " . round($z, 2));
Command::broadcastCommandMessage($sender, "Teleported " . $target->getDisplayName() . " to " . round($x, 2) . ", " . round($y, 2) . ", " . round($z, 2));
return true;
}