Cleaned up non-trivial getDrops() stuff

This commit is contained in:
Dylan K. Taylor
2017-12-13 14:47:50 +00:00
parent 90eed14cd6
commit 717b36a983
5 changed files with 48 additions and 28 deletions

View File

@ -56,13 +56,17 @@ class DeadBush extends Flowable{
return BlockToolType::TYPE_SHEARS;
}
public function getToolHarvestLevel() : int{
return 1;
}
public function getDrops(Item $item) : array{
if($item->isShears()){
return parent::getDrops($item);
if(!$this->isCompatibleWithTool($item)){
return [
ItemFactory::get(Item::STICK, 0, mt_rand(0, 2))
];
}
return [
ItemFactory::get(Item::STICK, 0, mt_rand(0, 2))
];
return parent::getDrops($item);
}
}