Block: added getDropsForIncompatibleTool()

This commit is contained in:
Dylan K. Taylor
2021-06-11 19:09:14 +01:00
parent e4ed7bc4ea
commit 7dcc4891ca
4 changed files with 18 additions and 19 deletions

View File

@ -33,12 +33,10 @@ class DoubleTallGrass extends DoublePlant{
return true;
}
public function getDrops(Item $item) : array{
if($this->top and !$this->breakInfo->isToolCompatible($item) and mt_rand(0, 7) === 0){
return [
VanillaItems::WHEAT_SEEDS()
];
public function getDropsForIncompatibleTool(Item $item) : array{
if($this->top and mt_rand(0, 7) === 0){
return [VanillaItems::WHEAT_SEEDS()];
}
return parent::getDrops($item);
return [];
}
}