mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-06 09:56:06 +00:00
don't try to send contents during inventory construction
This commit is contained in:
@ -84,8 +84,9 @@ class DoubleChestInventory extends ChestInventory implements InventoryHolder{
|
||||
|
||||
/**
|
||||
* @param Item[] $items
|
||||
* @param bool $send
|
||||
*/
|
||||
public function setContents(array $items){
|
||||
public function setContents(array $items, bool $send = true){
|
||||
$size = $this->getSize();
|
||||
if(count($items) > $size){
|
||||
$items = array_slice($items, 0, $size, true);
|
||||
@ -103,7 +104,9 @@ class DoubleChestInventory extends ChestInventory implements InventoryHolder{
|
||||
}
|
||||
}
|
||||
|
||||
$this->sendContents($this->getViewers());
|
||||
if($send){
|
||||
$this->sendContents($this->getViewers());
|
||||
}
|
||||
}
|
||||
|
||||
public function onOpen(Player $who){
|
||||
|
Reference in New Issue
Block a user