mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-20 19:49:44 +00:00
removed useless loop + fixed explosion error
This commit is contained in:
parent
be9a9c0c0d
commit
ab0b726904
2 changed files with 6 additions and 35 deletions
|
|
@ -95,8 +95,11 @@ class Explosion{
|
|||
$e = $server->api->entity->add($this->level, ENTITY_OBJECT, OBJECT_PRIMEDTNT, $data);
|
||||
$server->api->entity->spawnToAll($e);
|
||||
}elseif(mt_rand(0, 10000) < ((1 / $this->size) * 10000)){
|
||||
foreach($block->getDrops($this->air, $this->nullPlayer) as $drop){
|
||||
$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
|
||||
$dropz = $block->getDrops($this->air, $this->nullPlayer);
|
||||
if(is_array($dropz)){
|
||||
foreach($dropz as $drop){
|
||||
$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->setBlock($block, new AirBlock(), true);
|
||||
|
|
@ -110,4 +113,4 @@ class Explosion{
|
|||
$pk->records = $send;
|
||||
$server->api->player->broadcastPacket($this->level->players, $pk);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue