mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-19 15:35:52 +00:00
World: remove useless isChunkLoaded checks
getChunkEntities() will return an empty array if the chunk isn't loaded anyway, so this is just wasting CPU cycles.
This commit is contained in:
parent
b41960dfec
commit
9eb2a46942
@ -2292,9 +2292,6 @@ class World implements ChunkManager{
|
||||
|
||||
for($x = $minX; $x <= $maxX; ++$x){
|
||||
for($z = $minZ; $z <= $maxZ; ++$z){
|
||||
if(!$this->isChunkLoaded($x, $z)){
|
||||
continue;
|
||||
}
|
||||
foreach($this->getChunkEntities($x, $z) as $ent){
|
||||
if($ent !== $entity && $ent->boundingBox->intersectsWith($bb)){
|
||||
$nearby[] = $ent;
|
||||
@ -2335,9 +2332,6 @@ class World implements ChunkManager{
|
||||
|
||||
for($x = $minX; $x <= $maxX; ++$x){
|
||||
for($z = $minZ; $z <= $maxZ; ++$z){
|
||||
if(!$this->isChunkLoaded($x, $z)){
|
||||
continue;
|
||||
}
|
||||
foreach($this->getChunkEntities($x, $z) as $entity){
|
||||
if(!($entity instanceof $entityType) || $entity->isFlaggedForDespawn() || (!$includeDead && !$entity->isAlive())){
|
||||
continue;
|
||||
|
Loading…
x
Reference in New Issue
Block a user