mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-22 00:33:59 +00:00
Potato: drop poisonous potatoes when harvested, fixes #2830
This commit is contained in:
parent
4448f603a6
commit
883e135bc0
@ -40,9 +40,13 @@ class Potato extends Crops{
|
||||
}
|
||||
|
||||
public function getDropsForCompatibleTool(Item $item) : array{
|
||||
return [
|
||||
$result = [
|
||||
ItemFactory::get(Item::POTATO, 0, $this->getDamage() >= 0x07 ? mt_rand(1, 4) : 1)
|
||||
];
|
||||
if($this->getDamage() >= 7 && mt_rand(0, 49) === 0){
|
||||
$result[] = ItemFactory::get(Item::POISONOUS_POTATO);
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
public function getPickedItem() : Item{
|
||||
|
Loading…
x
Reference in New Issue
Block a user