World: rename getChunkAtPosition() to getOrLoadChunkAtPosition()

this more accurately reflects what it does.
This commit is contained in:
Dylan K. Taylor
2020-11-03 14:12:47 +00:00
parent bd78d0bff8
commit 5cc2a9c3dd
3 changed files with 4 additions and 4 deletions

View File

@@ -1936,7 +1936,7 @@ class World implements ChunkManager{
/**
* Returns the chunk containing the given Vector3 position.
*/
public function getChunkAtPosition(Vector3 $pos, bool $create = false) : ?Chunk{
public function getOrLoadChunkAtPosition(Vector3 $pos, bool $create = false) : ?Chunk{
return $this->getOrLoadChunk($pos->getFloorX() >> 4, $pos->getFloorZ() >> 4, $create);
}
@@ -2342,7 +2342,7 @@ class World implements ChunkManager{
$max = $this->worldHeight;
$v = $spawn->floor();
$chunk = $this->getChunkAtPosition($v, false);
$chunk = $this->getOrLoadChunkAtPosition($v, false);
$x = (int) $v->x;
$y = $v->y;
$z = (int) $v->z;