fixed dropped item loading, player arrows can be collected now, tweaked other stuff

This commit is contained in:
GameHerobrine 2024-03-24 06:26:20 +03:00
parent 3df03ae96b
commit 207a055f9b
4 changed files with 65 additions and 16 deletions

View file

@ -1848,7 +1848,7 @@ class Player{
"z" => $this->entity->z,
"yaw" => $this->entity->yaw,
"pitch" => $this->entity->pitch,
"shooter" => $this->entity,
"shooter" => $this->entity->eid,
"shootX" => $shootX,
"shootY" => $shootY,
"shootZ" => $shootZ
@ -1860,6 +1860,7 @@ class Player{
$e = $this->server->api->entity->add($this->level, ENTITY_OBJECT, OBJECT_SNOWBALL, $data);
}
$this->removeItem($slotItem->getID(), $slotItem->meta, 1);
$this->server->api->entity->spawnToAll($e);
}
@ -1903,7 +1904,8 @@ class Player{
"y" => $this->entity->y + 1.6,
"z" => $this->entity->z,
"yaw" => $this->entity->yaw,
"pitch" => $this->entity->pitch
"pitch" => $this->entity->pitch,
"shooter" => $this->entity->eid,
];
$e = $this->server->api->entity->add($this->level, ENTITY_OBJECT, OBJECT_ARROW, $d);
$e->speedX = -sin(($e->yaw / 180) * M_PI) * cos(($e->pitch / 180) * M_PI);