mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-13 09:19:42 +00:00
Player: clean up some crazy spawn logic in constructor
this was probably a leftover from some old code, I guess
This commit is contained in:
parent
db3305cb16
commit
e0a9ea2573
@ -315,7 +315,7 @@ class Player extends Human implements CommandSender, ChunkLoader, ChunkListener,
|
|||||||
$spawn = new Vector3($pos[0], $pos[1], $pos[2]);
|
$spawn = new Vector3($pos[0], $pos[1], $pos[2]);
|
||||||
}else{
|
}else{
|
||||||
$world = $this->server->getWorldManager()->getDefaultWorld(); //TODO: default world might be null
|
$world = $this->server->getWorldManager()->getDefaultWorld(); //TODO: default world might be null
|
||||||
$spawn = $world->getSpawnLocation();
|
$spawn = $world->getSafeSpawn();
|
||||||
$spawnReset = true;
|
$spawnReset = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -323,9 +323,6 @@ class Player extends Human implements CommandSender, ChunkLoader, ChunkListener,
|
|||||||
$world->registerChunkLoader($this, $spawn->getFloorX() >> 4, $spawn->getFloorZ() >> 4, true);
|
$world->registerChunkLoader($this, $spawn->getFloorX() >> 4, $spawn->getFloorZ() >> 4, true);
|
||||||
$world->registerChunkListener($this, $spawn->getFloorX() >> 4, $spawn->getFloorZ() >> 4);
|
$world->registerChunkListener($this, $spawn->getFloorX() >> 4, $spawn->getFloorZ() >> 4);
|
||||||
$this->usedChunks[World::chunkHash($spawn->getFloorX() >> 4, $spawn->getFloorZ() >> 4)] = false;
|
$this->usedChunks[World::chunkHash($spawn->getFloorX() >> 4, $spawn->getFloorZ() >> 4)] = false;
|
||||||
if($spawnReset){
|
|
||||||
$spawn = $world->getSafeSpawn($spawn);
|
|
||||||
}
|
|
||||||
|
|
||||||
if($namedtag === null){
|
if($namedtag === null){
|
||||||
$namedtag = EntityFactory::createBaseNBT($spawn);
|
$namedtag = EntityFactory::createBaseNBT($spawn);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user