mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-22 08:44:01 +00:00
Level: Added API method getChunkAtPosition()
This returns the chunk containing the given vector.
This commit is contained in:
parent
cb1eb1ee09
commit
d9ebe6f321
@ -2338,6 +2338,18 @@ class Level implements ChunkManager, Metadatable{
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the chunk containing the given Vector3 position.
|
||||
*
|
||||
* @param Vector3 $pos
|
||||
* @param bool $create
|
||||
*
|
||||
* @return null|Chunk
|
||||
*/
|
||||
public function getChunkAtPosition(Vector3 $pos, bool $create = false) : ?Chunk{
|
||||
return $this->getChunk($pos->getFloorX() >> 4, $pos->getFloorZ() >> 4, $create);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the chunks adjacent to the specified chunk.
|
||||
*
|
||||
|
Loading…
x
Reference in New Issue
Block a user