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

@ -465,12 +465,16 @@ class Level{
}
}
public function fastSetBlockUpdate($x, $y, $z, $id, $meta, $updateBlocksAround = false){
public function fastSetBlockUpdate($x, $y, $z, $id, $meta, $updateBlocksAround = false, $tiles = false){
$this->level->setBlock($x, $y, $z, $id, $meta);
$this->addBlockToSendQueue($x, $y, $z, $id, $meta);
if($updateBlocksAround){
$this->server->api->block->blockUpdateAround(new Position($x, $y, $z, $this), BLOCK_UPDATE_NORMAL, 1);
}
if($tiles && ($t = $this->server->api->tile->getXYZ($this, $x, $y, $z)) != false){ //TODO rewrite
$t->close();
}
}
public function onTick(PocketMinecraftServer $server, $currentTime){