Level: added getBiome()

this will be needed for weather impl, amongst other things.
This commit is contained in:
Dylan K. Taylor 2018-05-29 11:09:49 +01:00
parent 353a1d69db
commit ad61d70eee

View File

@ -43,6 +43,7 @@ use pocketmine\event\level\SpawnChangeEvent;
use pocketmine\event\player\PlayerInteractEvent;
use pocketmine\item\Item;
use pocketmine\item\ItemFactory;
use pocketmine\level\biome\Biome;
use pocketmine\level\format\Chunk;
use pocketmine\level\format\ChunkException;
use pocketmine\level\format\EmptySubChunk;
@ -2214,6 +2215,16 @@ class Level implements ChunkManager, Metadatable{
return $this->getChunk($x >> 4, $z >> 4, true)->getBiomeId($x & 0x0f, $z & 0x0f);
}
/**
* @param int $x
* @param int $z
*
* @return Biome
*/
public function getBiome(int $x, int $z) : Biome{
return Biome::getBiome($this->getBiomeId($x, $z));
}
/**
* @param int $x
* @param int $z