InventoryManager: remove redundant cyclic dependency

This commit is contained in:
Dylan K. Taylor 2019-06-26 13:57:52 +01:00
parent 9bebc6c69d
commit 26178b4435
2 changed files with 1 additions and 12 deletions

View File

@ -132,7 +132,7 @@ class InventoryManager{
}
public function syncAll() : void{
foreach($this->player->getAllWindows() as $inventory){
foreach($this->windowMap as $inventory){
$this->syncContents($inventory);
}
}

View File

@ -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);
}