Entity: added getEyePos()

This commit is contained in:
Dylan K. Taylor
2019-08-02 17:29:32 +01:00
parent e03f918806
commit 1cd955c216
5 changed files with 8 additions and 4 deletions

View File

@@ -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

View File

@@ -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();