mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-10-18 04:00:29 +00:00
Entity: added getEyePos()
This commit is contained in:
@@ -51,7 +51,7 @@ class Bow extends Tool{
|
||||
}
|
||||
|
||||
$nbt = EntityFactory::createBaseNBT(
|
||||
$player->add(0, $player->getEyeHeight(), 0),
|
||||
$player->getEyePos(),
|
||||
$player->getDirectionVector(),
|
||||
($player->yaw > 180 ? 360 : 0) - $player->yaw,
|
||||
-$player->pitch
|
||||
|
@@ -53,7 +53,7 @@ abstract class ProjectileItem extends Item{
|
||||
}
|
||||
|
||||
public function onClickAir(Player $player, Vector3 $directionVector) : ItemUseResult{
|
||||
$nbt = EntityFactory::createBaseNBT($player->add(0, $player->getEyeHeight(), 0), $directionVector, $player->yaw, $player->pitch);
|
||||
$nbt = EntityFactory::createBaseNBT($player->getEyePos(), $directionVector, $player->yaw, $player->pitch);
|
||||
$this->addExtraTags($nbt);
|
||||
|
||||
$class = $this->getProjectileEntityClass();
|
||||
|
Reference in New Issue
Block a user