mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-10-18 20:14:31 +00:00
Added item drop
This commit is contained in:
@@ -460,6 +460,21 @@ abstract class Entity extends Position implements Metadatable{
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Vector3
|
||||
*/
|
||||
public function getDirectionVector(){
|
||||
$pitch = ($this->pitch * M_PI) / 180;
|
||||
$yaw = (($this->yaw + 90) * M_PI) / 180;
|
||||
|
||||
$y = -sin(deg2rad($this->pitch));
|
||||
$xz = cos(deg2rad($this->pitch));
|
||||
$x = -$xz * sin(deg2rad($this->yaw));
|
||||
$z = $xz * cos(deg2rad($this->yaw));
|
||||
|
||||
return new Vector3($x, $y, $z);
|
||||
}
|
||||
|
||||
public function onUpdate(){
|
||||
if($this->closed !== false){
|
||||
return false;
|
||||
|
Reference in New Issue
Block a user