Use Entity->getDirectionVector() more

This commit is contained in:
Dylan K. Taylor
2017-09-03 12:08:40 +01:00
parent 4df261b75a
commit 89f5567476
2 changed files with 6 additions and 8 deletions

View File

@ -2376,11 +2376,7 @@ class Player extends Human implements CommandSender, ChunkLoader, IPlayer{
$this->level->sendBlocks([$this], [$target, $block], UpdateBlockPacket::FLAG_ALL_PRIORITY);
return true;
}elseif($packet->face === -1){
$directionVector = new Vector3(
-sin($this->yaw / 180 * M_PI) * cos($this->pitch / 180 * M_PI),
-sin($this->pitch / 180 * M_PI),
cos($this->yaw / 180 * M_PI) * cos($this->pitch / 180 * M_PI)
);
$directionVector = $this->getDirectionVector();
if($this->isCreative()){
$item = $this->inventory->getItemInHand();