mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-12 16:59:44 +00:00
InventoryManager: remove redundant cyclic dependency
This commit is contained in:
parent
9bebc6c69d
commit
26178b4435
@ -132,7 +132,7 @@ class InventoryManager{
|
||||
}
|
||||
|
||||
public function syncAll() : void{
|
||||
foreach($this->player->getAllWindows() as $inventory){
|
||||
foreach($this->windowMap as $inventory){
|
||||
$this->syncContents($inventory);
|
||||
}
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user