diff --git a/src/pocketmine/Player.php b/src/pocketmine/Player.php index a7eccee03..590ff0d18 100644 --- a/src/pocketmine/Player.php +++ b/src/pocketmine/Player.php @@ -1303,9 +1303,8 @@ class Player extends Human implements CommandSender, ChunkLoader, IPlayer{ $this->inventory->sendContents($this); $this->inventory->sendContents($this->getViewers()); $this->inventory->sendHeldItem($this->hasSpawned); - if($this->isCreative()){ - $this->inventory->sendCreativeContents(); - } + + $this->inventory->sendCreativeContents(); return true; } @@ -1937,9 +1936,7 @@ class Player extends Human implements CommandSender, ChunkLoader, IPlayer{ $this->sendCommandData(); - if($this->isCreative()){ - $this->inventory->sendCreativeContents(); - } + $this->inventory->sendCreativeContents(); $this->server->addOnlinePlayer($this); $this->server->onPlayerCompleteLoginSequence($this); diff --git a/src/pocketmine/inventory/PlayerInventory.php b/src/pocketmine/inventory/PlayerInventory.php index 0e4d92b99..6f294e7d2 100644 --- a/src/pocketmine/inventory/PlayerInventory.php +++ b/src/pocketmine/inventory/PlayerInventory.php @@ -509,7 +509,8 @@ class PlayerInventory extends BaseInventory{ public function sendCreativeContents(){ $pk = new InventoryContentPacket(); $pk->windowId = ContainerIds::CREATIVE; - if($this->getHolder()->getGamemode() === Player::CREATIVE){ + + if(!$this->getHolder()->isSpectator()){ //fill it for all gamemodes except spectator foreach(Item::getCreativeItems() as $i => $item){ $pk->items[$i] = clone $item; }