Plant fix

This commit is contained in:
ArkQuark 2022-06-05 17:59:54 +03:00
parent 133f398a42
commit a8d4797cf2
8 changed files with 31 additions and 15 deletions

View file

@ -38,17 +38,16 @@ class FarmlandBlock extends TransparentBlock{
}
return false;
}
$this->level->scheduleBlockUpdate(new Position($this, 0, 0, $this->level), Utils::getRandomUpdateTicks(), BLOCK_UPDATE_RANDOM);
if($type === BLOCK_UPDATE_RANDOM){
if($this->checkWater()){
$this->level->setBlock($this, BlockAPI::get(FARMLAND, 1), true, false, true);
return BLOCK_UPDATE_RANDOM;
}
else{
if($this->getSide(1)->isFlowable) return BLOCK_UPDATE_RANDOM;
$this->level->setBlock($this, BlockAPI::get(DIRT, 0), true, false, true);
return BLOCK_UPDATE_RANDOM;
}
}
return false;
}