onUpdate is now static, disabled rail, water and lava updates to rework.

This commit is contained in:
GameHerobrine 2024-05-20 13:16:48 +03:00
parent 3c37dc446e
commit ee989ef556
38 changed files with 329 additions and 367 deletions

View file

@ -58,10 +58,10 @@ class FarmlandBlock extends TransparentBlock{
}
}
public function onUpdate($type){
public static function onUpdate(Level $level, $x, $y, $z, $type){
if($type === BLOCK_UPDATE_NORMAL){
if(!$this->getSide(1)->isTransparent){
$this->level->setBlock($this, BlockAPI::get(DIRT, 0), true, false, true);
if(!StaticBlock::getIsTransparent($level->level->getBlockID($x, $y + 1, $z))){
$level->fastSetBlockUpdate($x, $y, $z, DIRT, 0, true);
return $type;
}
}