Relocate biome ID constants to pocketmine\data\bedrock package

This commit is contained in:
Dylan K. Taylor
2020-11-01 16:53:06 +00:00
parent b176f4c12f
commit 4231bfdc7e
7 changed files with 79 additions and 45 deletions

View File

@ -30,23 +30,6 @@ use pocketmine\world\generator\populator\Populator;
abstract class Biome{
public const OCEAN = 0;
public const PLAINS = 1;
public const DESERT = 2;
public const MOUNTAINS = 3;
public const FOREST = 4;
public const TAIGA = 5;
public const SWAMP = 6;
public const RIVER = 7;
public const HELL = 8;
public const ICE_PLAINS = 12;
public const SMALL_MOUNTAINS = 20;
public const BIRCH_FOREST = 27;
public const MAX_BIOMES = 256;
/** @var int */

View File

@ -24,6 +24,7 @@ declare(strict_types=1);
namespace pocketmine\world\biome;
use pocketmine\block\utils\TreeType;
use pocketmine\data\bedrock\BiomeIds;
use pocketmine\utils\SingletonTrait;
final class BiomeRegistry{
@ -38,20 +39,20 @@ final class BiomeRegistry{
public function __construct(){
$this->biomes = new \SplFixedArray(Biome::MAX_BIOMES);
$this->register(Biome::OCEAN, new OceanBiome());
$this->register(Biome::PLAINS, new PlainBiome());
$this->register(Biome::DESERT, new DesertBiome());
$this->register(Biome::MOUNTAINS, new MountainsBiome());
$this->register(Biome::FOREST, new ForestBiome());
$this->register(Biome::TAIGA, new TaigaBiome());
$this->register(Biome::SWAMP, new SwampBiome());
$this->register(Biome::RIVER, new RiverBiome());
$this->register(BiomeIds::OCEAN, new OceanBiome());
$this->register(BiomeIds::PLAINS, new PlainBiome());
$this->register(BiomeIds::DESERT, new DesertBiome());
$this->register(BiomeIds::MOUNTAINS, new MountainsBiome());
$this->register(BiomeIds::FOREST, new ForestBiome());
$this->register(BiomeIds::TAIGA, new TaigaBiome());
$this->register(BiomeIds::SWAMP, new SwampBiome());
$this->register(BiomeIds::RIVER, new RiverBiome());
$this->register(Biome::ICE_PLAINS, new IcePlainsBiome());
$this->register(BiomeIds::ICE_PLAINS, new IcePlainsBiome());
$this->register(Biome::SMALL_MOUNTAINS, new SmallMountainsBiome());
$this->register(BiomeIds::SMALL_MOUNTAINS, new SmallMountainsBiome());
$this->register(Biome::BIRCH_FOREST, new ForestBiome(TreeType::BIRCH()));
$this->register(BiomeIds::BIRCH_FOREST, new ForestBiome(TreeType::BIRCH()));
}
public function register(int $id, Biome $biome) : void{