don't break double chests

This commit is contained in:
Dylan K. Taylor 2018-03-27 10:23:04 +01:00
parent 7e20385bdb
commit 30a83544a0

View File

@ -71,6 +71,17 @@ class DoubleChestInventory extends ChestInventory implements InventoryHolder{
return $index < $this->left->getSize() ? $this->left->clear($index, $send) : $this->right->clear($index - $this->right->getSize(), $send);
}
public function getContents(bool $includeEmpty = false) : array{
$result = $this->left->getContents($includeEmpty);
$leftSize = $this->left->getSize();
foreach($this->right->getContents($includeEmpty) as $i => $item){
$result[$i + $leftSize] = $item;
}
return $result;
}
/**
* @param Item[] $items
* @param bool $send