mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-07-06 01:51:51 +00:00
Fixed drops for DeadBush
This commit is contained in:
parent
42dd9d6abd
commit
b76b9d53fe
@ -23,6 +23,9 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace pocketmine\block;
|
namespace pocketmine\block;
|
||||||
|
|
||||||
|
use pocketmine\item\Item;
|
||||||
|
use pocketmine\item\ItemFactory;
|
||||||
|
use pocketmine\item\Tool;
|
||||||
use pocketmine\level\Level;
|
use pocketmine\level\Level;
|
||||||
use pocketmine\math\Vector3;
|
use pocketmine\math\Vector3;
|
||||||
|
|
||||||
@ -38,7 +41,6 @@ class DeadBush extends Flowable{
|
|||||||
return "Dead Bush";
|
return "Dead Bush";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public function onUpdate(int $type){
|
public function onUpdate(int $type){
|
||||||
if($type === Level::BLOCK_UPDATE_NORMAL){
|
if($type === Level::BLOCK_UPDATE_NORMAL){
|
||||||
if($this->getSide(Vector3::SIDE_DOWN)->isTransparent() === true){
|
if($this->getSide(Vector3::SIDE_DOWN)->isTransparent() === true){
|
||||||
@ -51,4 +53,17 @@ class DeadBush extends Flowable{
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getToolType() : int{
|
||||||
|
return Tool::TYPE_SHEARS;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getDrops(Item $item) : array{
|
||||||
|
if($item->isShears()){
|
||||||
|
return parent::getDrops($item);
|
||||||
|
}
|
||||||
|
|
||||||
|
return [
|
||||||
|
ItemFactory::get(Item::STICK, 0, mt_rand(0, 2))
|
||||||
|
];
|
||||||
|
}
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user