mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-24 04:14:07 +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)){
|
||||
continue;
|
||||
}
|
||||
foreach($this->getOrLoadChunk($x, $z)->getEntities() as $ent){
|
||||
foreach($this->getChunk($x, $z)->getEntities() as $ent){
|
||||
/** @var Entity|null $entity */
|
||||
if($ent->canBeCollidedWith() and ($entity === null or ($ent !== $entity and $entity->canCollideWith($ent))) and $ent->boundingBox->intersectsWith($bb)){
|
||||
$nearby[] = $ent;
|
||||
@ -1728,7 +1728,7 @@ class World implements ChunkManager{
|
||||
if(!$this->isChunkLoaded($x, $z)){
|
||||
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)){
|
||||
$nearby[] = $ent;
|
||||
}
|
||||
@ -1771,7 +1771,7 @@ class World implements ChunkManager{
|
||||
if(!$this->isChunkLoaded($x, $z)){
|
||||
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())){
|
||||
continue;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user