mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-22 08:44:01 +00:00
Level: added getBiome()
this will be needed for weather impl, amongst other things.
This commit is contained in:
parent
353a1d69db
commit
ad61d70eee
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user