Allow offline player data to be provided from a custom source

This commit is contained in:
Dylan K. Taylor
2021-02-07 20:29:37 +00:00
parent 7745310870
commit c05779314d
2 changed files with 7 additions and 7 deletions

View File

@ -229,7 +229,11 @@ class NetworkSession{
}
protected function createPlayer() : void{
$this->player = $this->server->createPlayer($this, $this->info, $this->authenticated);
//TODO: make this async
//TODO: what about allowing this to be provided by PlayerCreationEvent?
$offlinePlayerData = $this->server->getOfflinePlayerData($this->info->getUsername());
$this->player = $this->server->createPlayer($this, $this->info, $this->authenticated, $offlinePlayerData);
$this->invManager = new InventoryManager($this->player, $this);