All Downloads are FREE. Search and download functionalities are using the official Maven repository.

cn.nukkit.level.biome.impl.swamp.SwampBiome Maven / Gradle / Ivy

There is a newer version: 1.20.40-r1
Show newest version
package cn.nukkit.level.biome.impl.swamp;

import cn.nukkit.block.Block;
import cn.nukkit.block.BlockFlower;
import cn.nukkit.blockstate.BlockState;
import cn.nukkit.level.biome.type.GrassyBiome;
import cn.nukkit.level.generator.populator.impl.*;
import cn.nukkit.level.generator.populator.impl.tree.SwampTreePopulator;

import java.util.Arrays;

/**
 * @author MagicDroidX (Nukkit Project)
 */
public class SwampBiome extends GrassyBiome {

    public SwampBiome() {
        super();

        PopulatorDisk populatorDiskClay = new PopulatorDisk(1.0, BlockState.of(CLAY_BLOCK), 1, 2, 1, Arrays.asList(BlockState.of(DIRT), BlockState.of(CLAY_BLOCK)));
        populatorDiskClay.setBaseAmount(1);
        addPopulator(populatorDiskClay);

        PopulatorLilyPad lilypad = new PopulatorLilyPad();
        lilypad.setBaseAmount(4);
        lilypad.setRandomAmount(2);
        this.addPopulator(lilypad);

        SwampTreePopulator trees = new SwampTreePopulator();
        trees.setBaseAmount(2);
        this.addPopulator(trees);

        PopulatorSeagrass populatorSeagrass = new PopulatorSeagrass(0.6);
        populatorSeagrass.setBaseAmount(32);
        populatorSeagrass.setBaseAmount(32);
        addPopulator(populatorSeagrass);

        PopulatorFlower flower = new PopulatorFlower();
        flower.setBaseAmount(2);
        flower.addType(Block.RED_FLOWER, BlockFlower.TYPE_BLUE_ORCHID);
        this.addPopulator(flower);

        MushroomPopulator mushroom = new MushroomPopulator(1);
        mushroom.setBaseAmount(-5);
        mushroom.setRandomAmount(7);
        this.addPopulator(mushroom);

        PopulatorSmallMushroom smallMushroom = new PopulatorSmallMushroom();
        smallMushroom.setBaseAmount(0);
        smallMushroom.setRandomAmount(2);
        this.addPopulator(smallMushroom);

        this.setBaseHeight(-0.2f);
        this.setHeightVariation(0.1f);
    }

    @Override
    public String getName() {
        return "Swamp";
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy