fixed chance

This commit is contained in:
ArkQuark 2022-06-02 20:37:14 +03:00
parent 1ce5292981
commit 355c2167d1
3 changed files with 8 additions and 5 deletions

View file

@ -42,7 +42,7 @@ class DirtBlock extends SolidBlock{
$this->level->scheduleBlockUpdate(new Position($this, 0, 0, $this->level), Utils::getRandomUpdateTicks(), BLOCK_UPDATE_RANDOM);
if($type === BLOCK_UPDATE_RANDOM){
if(mt_rand(0, 3) == 0){
if(($this->getSide(1)->isTransparent === false) or ($this->getSide(1)->getID()->isLiquid) or ($this->getSide(1)->getID() == 60)) return false;
if(($this->getSide(1)->isTransparent === false) or ($this->getSide(1)->isLiquid) or ($this->getSide(1)->getID() == 60)) return false;
if($this->getGrassInRadius() == true){
$this->level->setBlock($this, BlockAPI::get(GRASS, 0), true, false, true);
return BLOCK_UPDATE_RANDOM;