mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-06 17:59:48 +00:00
Item: restrict bounds of count to 0-255
This commit is contained in:
@ -557,6 +557,10 @@ class Item implements ItemIds, \JsonSerializable{
|
||||
* @return $this
|
||||
*/
|
||||
public function setCount(int $count) : Item{
|
||||
if($count < 0 or $count > 255){
|
||||
throw new \InvalidArgumentException("Count must be in the range 0-255");
|
||||
}
|
||||
|
||||
$this->count = $count;
|
||||
|
||||
return $this;
|
||||
|
Reference in New Issue
Block a user