Added Vines and Mycelium blocks

This commit is contained in:
ArkQuark 2023-02-28 22:16:38 +03:00
parent 62e47bab13
commit 9118406d7d
6 changed files with 59 additions and 27 deletions

View file

@ -7,16 +7,16 @@ class MyceliumBlock extends SolidBlock{
$this->hardness = 3;
}
public function getDrops(Item $item, Player $player){
return array(
array(DIRT, 0, 1),
);
}
public function onUpdate($type){
if($type === BLOCK_UPDATE_RANDOM && !$this->getSide(1)->isTransparent && mt_rand(0, 2) == 1){
$this->level->setBlock($this, BlockAPI::get(DIRT, 0), true, false, true);
}
return BLOCK_UPDATE_RANDOM;
}
public function getDrops(Item $item, Player $player){
return array(
array(DIRT, 0, 1),
);
}
}