mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-07-12 12:55:21 +00:00
Level: add API method isInLoadedTerrain()
This commit is contained in:
parent
4aef9919dc
commit
8ac1b18b17
@ -2476,6 +2476,17 @@ class Level implements ChunkManager, Metadatable{
|
|||||||
return $this->getChunk($x >> 4, $z >> 4, true)->getHighestBlockAt($x & 0x0f, $z & 0x0f);
|
return $this->getChunk($x >> 4, $z >> 4, true)->getHighestBlockAt($x & 0x0f, $z & 0x0f);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns whether the given position is in a loaded area of terrain.
|
||||||
|
*
|
||||||
|
* @param Vector3 $pos
|
||||||
|
*
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
|
public function isInLoadedTerrain(Vector3 $pos) : bool{
|
||||||
|
return $this->isChunkLoaded($pos->getFloorX() >> 4, $pos->getFloorZ() >> 4);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param int $x
|
* @param int $x
|
||||||
* @param int $z
|
* @param int $z
|
||||||
|
Loading…
x
Reference in New Issue
Block a user