mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-22 00:33:59 +00:00
fixed extremely stupid bug with player spawns
This was causing new players to inexplicably spawn in the wrong place when joining a world for the first time which had a different level name than folder name. With LevelDB worlds, this caused them to spawn wayyyy up at y=32767 for no good reason.
This commit is contained in:
parent
1c12be6bf2
commit
f993358c5f
@ -1920,7 +1920,7 @@ class Player extends Human implements CommandSender, ChunkLoader, IPlayer{
|
||||
|
||||
if(($level = $this->server->getLevelByName($this->namedtag->getString("Level", "", true))) === null){
|
||||
$this->setLevel($this->server->getDefaultLevel());
|
||||
$this->namedtag->setString("Level", $this->level->getName());
|
||||
$this->namedtag->setString("Level", $this->level->getFolderName());
|
||||
$spawnLocation = $this->level->getSpawnLocation();
|
||||
$this->namedtag->setTag(new ListTag("Pos", [
|
||||
new DoubleTag("", $spawnLocation->x),
|
||||
|
@ -773,8 +773,8 @@ class Server{
|
||||
new DoubleTag("", $spawn->y),
|
||||
new DoubleTag("", $spawn->z)
|
||||
], NBT::TAG_Double),
|
||||
new StringTag("Level", $this->getDefaultLevel()->getName()),
|
||||
//new StringTag("SpawnLevel", $this->getDefaultLevel()->getName()),
|
||||
new StringTag("Level", $this->getDefaultLevel()->getFolderName()),
|
||||
//new StringTag("SpawnLevel", $this->getDefaultLevel()->getFolderName()),
|
||||
//new IntTag("SpawnX", (int) $spawn->x),
|
||||
//new IntTag("SpawnY", (int) $spawn->y),
|
||||
//new IntTag("SpawnZ", (int) $spawn->z),
|
||||
|
Loading…
x
Reference in New Issue
Block a user