pocketmine\level\generator\biome\Biome::getBiome PHP Method

getBiome() public static method

public static getBiome ( $id ) : Biome
$id
return Biome
    public static function getBiome($id)
    {
        return isset(self::$biomes[$id]) ? self::$biomes[$id] : self::$biomes[self::OCEAN];
    }

Usage Example

 public function execute(CommandSender $sender, array $args)
 {
     if (count($args) !== 1) {
         return false;
     }
     $player = $sender->getServer()->getPlayer($sender->getName());
     $biome = strtoupper($args[0]);
     $plot = $this->getPlugin()->getPlotByPosition($player->getPosition());
     if ($plot === null) {
         $sender->sendMessage(TextFormat::RED . "You are not standing on an island");
         return true;
     }
     if ($plot->owner !== $sender->getName()) {
         $sender->sendMessage(TextFormat::RED . "You are not the owner of this island");
         return true;
     }
     if (!isset($this->biomes[$biome])) {
         $sender->sendMessage(TextFormat::RED . "That biome doesn't exist");
         $biomes = implode(", ", array_keys($this->biomes));
         $sender->sendMessage(TextFormat::RED . "The possible biomes are: {$biomes}");
         return true;
     }
     $biome = Biome::getBiome($this->biomes[$biome]);
     if ($this->getPlugin()->setPlotBiome($plot, $biome)) {
         $sender->sendMessage(TextFormat::GREEN . "Changed the island biome");
     } else {
         $sender->sendMessage(TextFormat::RED . "Could not change the island biome");
     }
     return true;
 }
All Usage Examples Of pocketmine\level\generator\biome\Biome::getBiome