Merge branch 'stable' into next-minor

This commit is contained in:
Dylan K. Taylor
2020-02-10 11:40:08 +00:00
539 changed files with 3706 additions and 6211 deletions

View File

@@ -46,7 +46,10 @@ abstract class BaseInventory implements Inventory{
protected $name;
/** @var string */
protected $title;
/** @var \SplFixedArray|(Item|null)[] */
/**
* @var \SplFixedArray|(Item|null)[]
* @phpstan-var \SplFixedArray<Item|null>
*/
protected $slots;
/** @var Player[] */
protected $viewers = [];
@@ -55,8 +58,6 @@ abstract class BaseInventory implements Inventory{
/**
* @param Item[] $items
* @param int $size
* @param string $title
*/
public function __construct(array $items = [], int $size = null, string $title = null){
$this->slots = new \SplFixedArray($size ?? $this->getDefaultSize());
@@ -73,7 +74,6 @@ abstract class BaseInventory implements Inventory{
/**
* Returns the size of the inventory.
* @return int
*/
public function getSize() : int{
return $this->slots->getSize();
@@ -83,7 +83,7 @@ abstract class BaseInventory implements Inventory{
* Sets the new size of the inventory.
* WARNING: If the size is smaller, any items past the new size will be lost.
*
* @param int $size
* @return void
*/
public function setSize(int $size){
$this->slots->setSize($size);
@@ -100,8 +100,6 @@ abstract class BaseInventory implements Inventory{
}
/**
* @param bool $includeEmpty
*
* @return Item[]
*/
public function getContents(bool $includeEmpty = false) : array{
@@ -121,7 +119,6 @@ abstract class BaseInventory implements Inventory{
/**
* @param Item[] $items
* @param bool $send
*/
public function setContents(array $items, bool $send = true) : void{
if(count($items) > $this->getSize()){
@@ -148,9 +145,6 @@ abstract class BaseInventory implements Inventory{
/**
* Drops the contents of the inventory into the specified Level at the specified position and clears the inventory
* contents.
*
* @param Level $level
* @param Vector3 $position
*/
public function dropContents(Level $level, Vector3 $position) : void{
foreach($this->getContents() as $item){
@@ -437,7 +431,6 @@ abstract class BaseInventory implements Inventory{
}
}
/**
* @param Player|Player[] $target
*/
@@ -460,7 +453,6 @@ abstract class BaseInventory implements Inventory{
}
/**
* @param int $index
* @param Player|Player[] $target
*/
public function sendSlot(int $index, $target) : void{