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