mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-07 12:18:46 +00:00
Entity: micro optimisation for checkBlockIntersections()
This commit is contained in:
parent
56fbd45dd5
commit
9561ae5af7
@ -1325,12 +1325,14 @@ abstract class Entity{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(count($vectors) > 0){
|
||||||
$vector = Vector3::sum(...$vectors);
|
$vector = Vector3::sum(...$vectors);
|
||||||
if($vector->lengthSquared() > 0){
|
if($vector->lengthSquared() > 0){
|
||||||
$d = 0.014;
|
$d = 0.014;
|
||||||
$this->motion = $this->motion->addVector($vector->normalize()->multiply($d));
|
$this->motion = $this->motion->addVector($vector->normalize()->multiply($d));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public function getPosition() : Position{
|
public function getPosition() : Position{
|
||||||
return $this->location->asPosition();
|
return $this->location->asPosition();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user