mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-06 01:46:04 +00:00
Remove premature optimisation from World::getCollidingEntities()
this is already covered in more fine-grained detail by canCollideWith(). [bc break]
This commit is contained in:
@ -1904,11 +1904,9 @@ class World implements ChunkManager{
|
||||
public function getCollidingEntities(AxisAlignedBB $bb, ?Entity $entity = null) : array{
|
||||
$nearby = [];
|
||||
|
||||
if($entity === null || $entity->canCollide){
|
||||
foreach($this->getNearbyEntities($bb, $entity) as $ent){
|
||||
if($ent->canBeCollidedWith() && ($entity === null || $entity->canCollideWith($ent))){
|
||||
$nearby[] = $ent;
|
||||
}
|
||||
foreach($this->getNearbyEntities($bb, $entity) as $ent){
|
||||
if($ent->canBeCollidedWith() && ($entity === null || $entity->canCollideWith($ent))){
|
||||
$nearby[] = $ent;
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user