Entities spawn with their motion

This commit is contained in:
Shoghi Cervantes
2013-05-31 12:04:43 +02:00
parent d7f74a6725
commit 3ac4b0af68
3 changed files with 24 additions and 4 deletions

View File

@@ -283,7 +283,9 @@ class BlockAPI{
if(($player->gamemode & 0x01) === 0x00 and count($drops) > 0){
foreach($drops as $drop){
$this->server->api->entity->drop(new Position($target->x + 0.5, $target->y, $target->z + 0.5, $target->level), BlockAPI::getItem($drop[0] & 0xFFFF, $drop[1] & 0xFFFF, $drop[2] & 0xFF));
for($c = 0; $c < $drop[2]; ++$c){
$this->server->api->entity->drop(new Position($target->x + 0.5, $target->y, $target->z + 0.5, $target->level), BlockAPI::getItem($drop[0] & 0xFFFF, $drop[1] & 0xFFFF, 1));
}
}
}
return false;

View File

@@ -110,9 +110,9 @@ class EntityAPI{
"x" => $pos->x,
"y" => $pos->y + 0.19,
"z" => $pos->z,
"speedX" => mt_rand(-1, 1) / 6,
"speedY" => mt_rand(5, 8) / 2,
"speedZ" => mt_rand(-1, 1) / 6,
"speedX" => mt_rand(-3, 3) / 8,
"speedY" => mt_rand(5, 8) / 1.5,
"speedZ" => mt_rand(-3, 3) / 8,
"item" => $item,
);
if($this->server->api->handle("item.drop", $data) !== false){