mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-21 16:24:05 +00:00
NetworkSession: don't crash on teleporting to other world during PlayerLoginEvent
This commit is contained in:
parent
5324474194
commit
f9bfc0df73
@ -942,11 +942,13 @@ class NetworkSession{
|
||||
}
|
||||
|
||||
public function onEnterWorld() : void{
|
||||
$world = $this->player->getWorld();
|
||||
$this->syncWorldTime($world->getTime());
|
||||
$this->syncWorldDifficulty($world->getDifficulty());
|
||||
//TODO: weather needs to be synced here (when implemented)
|
||||
//TODO: world spawn needs to be synced here
|
||||
if($this->player !== null){
|
||||
$world = $this->player->getWorld();
|
||||
$this->syncWorldTime($world->getTime());
|
||||
$this->syncWorldDifficulty($world->getDifficulty());
|
||||
//TODO: weather needs to be synced here (when implemented)
|
||||
//TODO: world spawn needs to be synced here
|
||||
}
|
||||
}
|
||||
|
||||
public function syncWorldTime(int $worldTime) : void{
|
||||
|
Loading…
x
Reference in New Issue
Block a user