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

@ -64,12 +64,11 @@ class LeavesBlock extends TransparentBlock{
}
}
}
public function onUpdate($type){
if($type === BLOCK_UPDATE_NORMAL){
if(($this->meta & 0b00001100) === 0){
$this->meta |= 0x08;
$this->level->fastSetBlockUpdate($this->x, $this->y, $this->z, $this->id, $this->meta);
}
public static function onUpdate(Level $level, $x, $y, $z, $type){
[$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;
}