diff --git a/src/API/BlockAPI.php b/src/API/BlockAPI.php index 3c659047..bb098a1b 100644 --- a/src/API/BlockAPI.php +++ b/src/API/BlockAPI.php @@ -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; diff --git a/src/API/EntityAPI.php b/src/API/EntityAPI.php index 0e71d510..59874882 100644 --- a/src/API/EntityAPI.php +++ b/src/API/EntityAPI.php @@ -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){ diff --git a/src/world/Entity.php b/src/world/Entity.php index 544fa525..6ac9aa6d 100644 --- a/src/world/Entity.php +++ b/src/world/Entity.php @@ -547,6 +547,12 @@ class Entity extends Position{ "meta" => $this->meta, "stack" => $this->stack, )); + $player->dataPacket(MC_SET_ENTITY_MOTION, array( + "eid" => $this->eid, + "speedX" => (int) ($this->speedX * 400), + "speedY" => (int) ($this->speedY * 400), + "speedZ" => (int) ($this->speedZ * 400), + )); break; case ENTITY_MOB: $player->dataPacket(MC_ADD_MOB, array( @@ -557,6 +563,12 @@ class Entity extends Position{ "z" => $this->z, "metadata" => $this->getMetadata(), )); + $player->dataPacket(MC_SET_ENTITY_MOTION, array( + "eid" => $this->eid, + "speedX" => (int) ($this->speedX * 400), + "speedY" => (int) ($this->speedY * 400), + "speedZ" => (int) ($this->speedZ * 400), + )); break; case ENTITY_OBJECT: if($this->type === OBJECT_PAINTING){ @@ -579,6 +591,12 @@ class Entity extends Position{ "z" => $this->z, "did" => -$this->data["Tile"], )); + $player->dataPacket(MC_SET_ENTITY_MOTION, array( + "eid" => $this->eid, + "speedX" => (int) ($this->speedX * 400), + "speedY" => (int) ($this->speedY * 400), + "speedZ" => (int) ($this->speedZ * 400), + )); break; } }