some new blocks

This commit is contained in:
FreeHij 2023-02-21 21:08:26 +03:00
parent 9b5a3959c4
commit 1a01483453
18 changed files with 395 additions and 9 deletions

View file

@ -34,7 +34,7 @@ class GrassBlock extends SolidBlock{
return false;
}
public function seedsDrop(){
/*public function seedsDrop(){
$chance = Utils::randomFloat() * 100;
if($chance <= 1){
ServerAPI::request()->api->entity->drop(new Position($this->x+0.5, $this->y+1, $this->z+0.5, $this->level), BlockAPI::getItem(458,0,1));
@ -45,7 +45,7 @@ class GrassBlock extends SolidBlock{
return;
}
return;
}
}*/
public function onUpdate($type){
if($type === BLOCK_UPDATE_RANDOM && !$this->getSide(1)->isTransparent && mt_rand(0, 2) == 1){
@ -53,5 +53,4 @@ class GrassBlock extends SolidBlock{
}
return BLOCK_UPDATE_RANDOM;
}
}