mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-24 20:34:02 +00:00
World: change some usages of getOrLoadChunk() to getChunk()
these usages don't require getOrLoadChunk() because they already check for unloaded chunks anyway.
This commit is contained in:
parent
092a69e415
commit
3c892182fd
@ -1697,7 +1697,7 @@ class World implements ChunkManager{
|
|||||||
if(!$this->isChunkLoaded($x, $z)){
|
if(!$this->isChunkLoaded($x, $z)){
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
foreach($this->getOrLoadChunk($x, $z)->getEntities() as $ent){
|
foreach($this->getChunk($x, $z)->getEntities() as $ent){
|
||||||
/** @var Entity|null $entity */
|
/** @var Entity|null $entity */
|
||||||
if($ent->canBeCollidedWith() and ($entity === null or ($ent !== $entity and $entity->canCollideWith($ent))) and $ent->boundingBox->intersectsWith($bb)){
|
if($ent->canBeCollidedWith() and ($entity === null or ($ent !== $entity and $entity->canCollideWith($ent))) and $ent->boundingBox->intersectsWith($bb)){
|
||||||
$nearby[] = $ent;
|
$nearby[] = $ent;
|
||||||
@ -1728,7 +1728,7 @@ class World implements ChunkManager{
|
|||||||
if(!$this->isChunkLoaded($x, $z)){
|
if(!$this->isChunkLoaded($x, $z)){
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
foreach($this->getOrLoadChunk($x, $z)->getEntities() as $ent){
|
foreach($this->getChunk($x, $z)->getEntities() as $ent){
|
||||||
if($ent !== $entity and $ent->boundingBox->intersectsWith($bb)){
|
if($ent !== $entity and $ent->boundingBox->intersectsWith($bb)){
|
||||||
$nearby[] = $ent;
|
$nearby[] = $ent;
|
||||||
}
|
}
|
||||||
@ -1771,7 +1771,7 @@ class World implements ChunkManager{
|
|||||||
if(!$this->isChunkLoaded($x, $z)){
|
if(!$this->isChunkLoaded($x, $z)){
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
foreach($this->getOrLoadChunk($x, $z)->getEntities() as $entity){
|
foreach($this->getChunk($x, $z)->getEntities() as $entity){
|
||||||
if(!($entity instanceof $entityType) or $entity->isFlaggedForDespawn() or (!$includeDead and !$entity->isAlive())){
|
if(!($entity instanceof $entityType) or $entity->isFlaggedForDespawn() or (!$includeDead and !$entity->isAlive())){
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user