Changed Block->getDrops() to return Item[]

This commit is contained in:
Dylan K. Taylor
2017-08-18 11:21:33 +01:00
parent c8ed2406d7
commit d8f0dd6db8
94 changed files with 314 additions and 373 deletions

View File

@ -37,14 +37,9 @@ class Potato extends Crops{
return "Potato Block";
}
public function getDrops(Item $item){
$drops = [];
if($this->meta >= 0x07){
$drops[] = [Item::POTATO, 0, mt_rand(1, 4)];
}else{
$drops[] = [Item::POTATO, 0, 1];
}
return $drops;
public function getDrops(Item $item) : array{
return [
Item::get(Item::POTATO, 0, $this->getDamage() >= 0x07 ? mt_rand(1, 4) : 1)
];
}
}