This commit is contained in:
paulevsGitch 2021-12-06 08:15:40 +03:00
parent 1f8fd77a46
commit 2fcfd695f9

View file

@ -672,6 +672,13 @@ public class BiomeAPI {
accessor.bcl_setSpawners(spawners);
}
/**
* Get biome surface block. Can be used to get terrain material for features or other things.
* @param pos {@link BlockPos} position to get block.
* @param biome {@link Biome} to get block from.
* @param level {@link ServerLevel} current server level.
* @return {@link BlockState} with the biome surface or AIR if it fails.
*/
public static BlockState getBiomeSurfaceBlock(BlockPos pos, Biome biome, ServerLevel level) {
ChunkGenerator generator = level.getChunkSource().getGenerator();
if (generator instanceof NoiseBasedChunkGenerator) {