Use SplFixedArrays in inventory, added more typehints and cleaned up some duplicated code

This commit is contained in:
Dylan K. Taylor
2017-08-09 13:12:07 +01:00
parent 75644b5df2
commit 260179197b
9 changed files with 152 additions and 175 deletions

View File

@ -828,6 +828,10 @@ class Item implements ItemIds, \JsonSerializable{
$this->count = $count;
}
public function isNull() : bool{
return $this->count <= 0 or $this->id === Item::AIR;
}
/**
* Returns the name of the item, or the custom name if it is set.
* @return string