Level: add API method isInLoadedTerrain()

This commit is contained in:
Dylan K. Taylor 2018-10-20 19:09:53 +01:00
parent 4aef9919dc
commit 8ac1b18b17

View File

@ -2476,6 +2476,17 @@ class Level implements ChunkManager, Metadatable{
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 $z