This commit is contained in:
GameHerobrine 2023-08-17 15:17:49 +03:00
parent aa0031b910
commit b712c4b7a9
10 changed files with 257 additions and 100 deletions

View file

@ -84,6 +84,20 @@ class Level{
return $aABBs;
}
public function fastSetBlockUpdate($x, $y, $z, $id, $meta, $updateBlocksAround = false){
$this->level->setBlock($x, $y, $z, $id, $meta);
$pk = new UpdateBlockPacket;
$pk->x = $x;
$pk->y = $y;
$pk->z = $z;
$pk->block = $id;
$pk->meta = $meta;
$this->server->api->player->broadcastPacket($this->players, $pk);
if($updateBlocksAround){
$this->server->api->block->blockUpdateAround(new Position($x, $y, $z, $this), BLOCK_UPDATE_NORMAL, 1);
}
}
public function __destruct(){
if(isset($this->level)){
$this->save(false, false);