separated neighbor updates and scheduled updates

This commit is contained in:
GameHerobrine 2024-05-22 06:15:34 +03:00
parent ee989ef556
commit 2ebc482e3d
36 changed files with 197 additions and 262 deletions

View file

@ -64,13 +64,12 @@ class LeavesBlock extends TransparentBlock{
}
}
}
public static function onUpdate(Level $level, $x, $y, $z, $type){
public static function neighborChanged(Level $level, $x, $y, $z, $nX, $nY, $nZ, $oldID){
[$id, $meta] = $level->level->getBlock($x, $y, $z);
if(($meta & 0b00001100) === 0){
$meta |= 0x08;
$level->fastSetBlockUpdate($x, $y, $z, $id, $meta); //TODO maybe use $level->level->setBlock directly, the client doesnt need to know thism info.
}
return false;
}
public function place(Item $item, Player $player, Block $block, Block $target, $face, $fx, $fy, $fz){