mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-22 16:51:42 +00:00
Fixed inventory being sent before spawning
This commit is contained in:
parent
ebe8a902e5
commit
6e77901453
@ -625,10 +625,6 @@ class Player extends Human implements CommandSender, InventoryHolder, IPlayer{
|
||||
|
||||
$this->spawned = true;
|
||||
|
||||
$this->sendSettings();
|
||||
$this->inventory->sendContents($this);
|
||||
$this->inventory->sendArmorContents($this);
|
||||
|
||||
$this->blocked = false;
|
||||
|
||||
$pk = new SetTimePacket;
|
||||
@ -643,6 +639,10 @@ class Player extends Human implements CommandSender, InventoryHolder, IPlayer{
|
||||
|
||||
$this->teleport($ev->getRespawnPosition());
|
||||
|
||||
$this->sendSettings();
|
||||
$this->inventory->sendContents($this);
|
||||
$this->inventory->sendArmorContents($this);
|
||||
|
||||
$this->spawnToAll();
|
||||
|
||||
$this->server->getPluginManager()->callEvent($ev = new PlayerJoinEvent($this, TextFormat::YELLOW . $this->getName() . " joined the game"));
|
||||
|
@ -392,7 +392,7 @@ abstract class BaseInventory implements Inventory{
|
||||
}
|
||||
|
||||
foreach($target as $player){
|
||||
if(($id = $player->getWindowId($this)) === -1){
|
||||
if(($id = $player->getWindowId($this)) === -1 or $player->spawned !== true){
|
||||
$this->close($player);
|
||||
continue;
|
||||
}
|
||||
|
@ -333,7 +333,7 @@ class PlayerInventory extends BaseInventory{
|
||||
$pk->hotbar[] = $index <= -1 ? -1 : $index + 9;
|
||||
}
|
||||
}
|
||||
if(($id = $player->getWindowId($this)) === -1){
|
||||
if(($id = $player->getWindowId($this)) === -1 or $player->spawned !== true){
|
||||
$this->close($player);
|
||||
continue;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user