rewrite of interact system, bugfixes, ai tweaks

This commit is contained in:
GameHerobrine 2022-11-01 00:55:49 +03:00
parent f5222be9d2
commit ac1a1b2449
62 changed files with 649 additions and 491 deletions

View file

@ -100,9 +100,8 @@ class Explosion{
$server->api->entity->drop(new Position($block->x + 0.5, $block->y, $block->z + 0.5, $this->level), BlockAPI::getItem($drop[0], $drop[1], $drop[2])); //id, meta, count
}
}
$this->level->level->setBlockID($block->x, $block->y, $block->z, 0);
ServerAPI::request()->api->block->blockUpdateAround(new Position($block->x, $block->y, $block->z, $this->level), BLOCK_UPDATE_NORMAL, 5);
$send[] = new Vector3($block->x - $source->x, $block->y - $source->y, $block->z - $source->z);
$this->level->setBlock($block, new AirBlock(), true, false, true);
$send[] = $block->subtract($source);
}
$pk = new ExplodePacket;
$pk->x = $this->source->x;
@ -112,4 +111,4 @@ class Explosion{
$pk->records = $send;
$server->api->player->broadcastPacket($this->level->players, $pk);
}
}
}