mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-21 12:09:43 +00:00
some new blocks
This commit is contained in:
parent
9b5a3959c4
commit
1a01483453
18 changed files with 395 additions and 9 deletions
22
src/material/block/solid/MyceliumBlock.php
Normal file
22
src/material/block/solid/MyceliumBlock.php
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
<?php
|
||||
|
||||
class MyceliumBlock extends SolidBlock{
|
||||
public function __construct(){
|
||||
parent::__construct(MYCELIUM, 0, "Mycelium");
|
||||
$this->isActivable = true;
|
||||
$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;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue