diff --git a/src/pocketmine/network/mcpe/InventoryManager.php b/src/pocketmine/network/mcpe/InventoryManager.php index 097e55ee6..da285bb87 100644 --- a/src/pocketmine/network/mcpe/InventoryManager.php +++ b/src/pocketmine/network/mcpe/InventoryManager.php @@ -132,7 +132,7 @@ class InventoryManager{ } public function syncAll() : void{ - foreach($this->player->getAllWindows() as $inventory){ + foreach($this->windowMap as $inventory){ $this->syncContents($inventory); } } diff --git a/src/pocketmine/player/Player.php b/src/pocketmine/player/Player.php index 1941643c9..b9dd0d655 100644 --- a/src/pocketmine/player/Player.php +++ b/src/pocketmine/player/Player.php @@ -2677,17 +2677,6 @@ class Player extends Human implements CommandSender, ChunkLoader, ChunkListener, $this->permanentWindows = []; } - /** - * @return Inventory[] - */ - public function getAllWindows() : array{ - $windows = $this->permanentWindows; - if($this->currentWindow !== null){ - $windows[] = $this->currentWindow; - } - return $windows; - } - public function setMetadata(string $metadataKey, MetadataValue $newMetadataValue) : void{ $this->server->getPlayerMetadata()->setMetadata($this, $metadataKey, $newMetadataValue); }