diff --git a/src/pocketmine/level/Level.php b/src/pocketmine/level/Level.php index 73774899a..bfb3db884 100644 --- a/src/pocketmine/level/Level.php +++ b/src/pocketmine/level/Level.php @@ -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