mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-21 12:09:43 +00:00
rewrite of interact system, bugfixes, ai tweaks
This commit is contained in:
parent
f5222be9d2
commit
ac1a1b2449
62 changed files with 649 additions and 491 deletions
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -41,7 +41,7 @@ class Level{
|
|||
$x0 = floor($aABB->minX);
|
||||
$x1 = ceil($aABB->maxX);
|
||||
$y0 = floor($aABB->minY);
|
||||
$y1 = ceil($aABB->maxY);
|
||||
$y1 = round($aABB->maxY);
|
||||
$z0 = floor($aABB->minZ);
|
||||
$z1 = ceil($aABB->maxZ);
|
||||
$x0 = $x0 < 0 ? 0 : $x0;
|
||||
|
|
@ -51,11 +51,11 @@ class Level{
|
|||
$y1 = $y1 > 128 ? 128 : $y1;
|
||||
$z1 = $z1 > 256 ? 256 : $z1;
|
||||
|
||||
for($x = $x0; $x < $x1; ++$x) {
|
||||
for($x = $x0; $x <= $x1; ++$x) {
|
||||
for($y = $y0; $y < $y1; ++$y) {
|
||||
for($z = $z0; $z < $z1; ++$z) {
|
||||
for($z = $z0; $z <= $z1; ++$z) {
|
||||
$b = $this->getBlockWithoutVector($x, $y, $z);
|
||||
if($b != false && $b->isSolid) {
|
||||
if($b != false && $b->boundingBox->intersectsWith($aABB) && $b->isSolid) {
|
||||
$aABBs[] = $b->boundingBox;
|
||||
}
|
||||
}
|
||||
|
|
@ -89,7 +89,7 @@ class Level{
|
|||
"id" => $entity->type,
|
||||
"Color" => @$entity->data["Color"],
|
||||
"Sheared" => @$entity->data["Sheared"],
|
||||
"Saddled" => @$entity->data["Saddled"],
|
||||
"State" => @$entity->data["State"],
|
||||
"IsBaby" => @$entity->data["IsBaby"],
|
||||
"Health" => $entity->health,
|
||||
"Pos" => [
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue