if (blockPosition == null) {
player.printError("No block in sight!");
return;
}
BaseBiome biome = player.getWorld().getBiome(blockPosition.toVector2D());
biomes.add(biome);
qualifier = "at line of sight point";
} else if (args.hasFlag('p')) {
BaseBiome biome = player.getWorld().getBiome(player.getPosition().toVector2D());
biomes.add(biome);
qualifier = "at your position";
} else {
World world = player.getWorld();
Region region = session.getSelection(world);
if (region instanceof FlatRegion) {
for (Vector2D pt : ((FlatRegion) region).asFlatRegion()) {
biomes.add(world.getBiome(pt));
}
} else {
for (Vector pt : region) {
biomes.add(world.getBiome(pt.toVector2D()));
}
}
qualifier = "in your selection";
}
player.print(biomes.size() != 1 ? "Biomes " + qualifier + ":" : "Biome " + qualifier + ":");
for (BaseBiome biome : biomes) {
BiomeData data = biomeRegistry.getData(biome);
if (data != null) {
player.print(" " + data.getName());
} else {
player.print(" <unknown #" + biome.getId() + ">");
}
}
}