Fixed player spawnpoints glitching and not saving

This commit is contained in:
Dylan K. Taylor
2017-06-21 12:17:26 +01:00
parent 080b35bf53
commit 03826d9cbc
2 changed files with 13 additions and 8 deletions

View File

@ -26,6 +26,7 @@ namespace pocketmine\command\defaults;
use pocketmine\command\Command;
use pocketmine\command\CommandSender;
use pocketmine\event\TranslationContainer;
use pocketmine\level\Level;
use pocketmine\level\Position;
use pocketmine\Player;
use pocketmine\utils\TextFormat;
@ -70,8 +71,8 @@ class SpawnpointCommand extends VanillaCommand{
if(count($args) === 4){
if($level !== null){
$pos = $sender instanceof Player ? $sender->getPosition() : $level->getSpawnLocation();
$x = (int) $this->getRelativeDouble($pos->x, $sender, $args[1]);
$y = $this->getRelativeDouble($pos->y, $sender, $args[2], 0, 128);
$x = $this->getRelativeDouble($pos->x, $sender, $args[1]);
$y = $this->getRelativeDouble($pos->y, $sender, $args[2], 0, Level::Y_MAX);
$z = $this->getRelativeDouble($pos->z, $sender, $args[3]);
$target->setSpawn(new Position($x, $y, $z, $level));