Search in sources :

Example 1 with BiomeSelector

use of cn.nukkit.level.generator.biome.BiomeSelector in project Nukkit by Nukkit.

the class Normal method init.

@Override
public void init(ChunkManager level, NukkitRandom random) {
    this.level = level;
    this.nukkitRandom = random;
    this.random = new Random();
    this.nukkitRandom.setSeed(this.level.getSeed());
    this.localSeed1 = this.random.nextLong();
    this.localSeed2 = this.random.nextLong();
    this.noiseSeaFloor = new Simplex(this.nukkitRandom, 1F, 1F / 8F, 1F / 64F);
    this.noiseLand = new Simplex(this.nukkitRandom, 2F, 1F / 8F, 1F / 512F);
    this.noiseMountains = new Simplex(this.nukkitRandom, 4F, 1F, 1F / 500F);
    this.noiseBaseGround = new Simplex(this.nukkitRandom, 4F, 1F / 4F, 1F / 64F);
    this.noiseRiver = new Simplex(this.nukkitRandom, 2F, 1F, 1F / 512F);
    this.nukkitRandom.setSeed(this.level.getSeed());
    this.selector = new BiomeSelector(this.nukkitRandom, Biome.getBiome(Biome.FOREST));
    this.heightOffset = random.nextRange(-5, 3);
    this.selector.addBiome(Biome.getBiome(OCEAN));
    this.selector.addBiome(Biome.getBiome(PLAINS));
    this.selector.addBiome(Biome.getBiome(DESERT));
    this.selector.addBiome(Biome.getBiome(FOREST));
    this.selector.addBiome(Biome.getBiome(TAIGA));
    this.selector.addBiome(Biome.getBiome(RIVER));
    this.selector.addBiome(Biome.getBiome(ICE_PLAINS));
    this.selector.addBiome(Biome.getBiome(BIRCH_FOREST));
    this.selector.addBiome(Biome.getBiome(JUNGLE));
    this.selector.addBiome(Biome.getBiome(SAVANNA));
    this.selector.addBiome(Biome.getBiome(ROOFED_FOREST));
    this.selector.addBiome(Biome.getBiome(ROOFED_FOREST_M));
    this.selector.addBiome(Biome.getBiome(MUSHROOM_ISLAND));
    this.selector.addBiome(Biome.getBiome(SWAMP));
    this.selector.recalculate();
    PopulatorCaves caves = new PopulatorCaves();
    this.populators.add(caves);
    PopulatorRavines ravines = new PopulatorRavines();
    this.populators.add(ravines);
    // PopulatorDungeon dungeons = new PopulatorDungeon();
    // this.populators.add(dungeons);
    PopulatorGroundCover cover = new PopulatorGroundCover();
    this.generationPopulators.add(cover);
    PopulatorOre ores = new PopulatorOre();
    ores.setOreTypes(new OreType[] { new OreType(new BlockOreCoal(), 20, 17, 0, 128), new OreType(new BlockOreIron(), 20, 9, 0, 64), new OreType(new BlockOreRedstone(), 8, 8, 0, 16), new OreType(new BlockOreLapis(), 1, 7, 0, 16), new OreType(new BlockOreGold(), 2, 9, 0, 32), new OreType(new BlockOreDiamond(), 1, 8, 0, 16), new OreType(new BlockDirt(), 10, 33, 0, 128), new OreType(new BlockGravel(), 8, 33, 0, 128), new OreType(new BlockStone(BlockStone.GRANITE), 10, 33, 0, 80), new OreType(new BlockStone(BlockStone.DIORITE), 10, 33, 0, 80), new OreType(new BlockStone(BlockStone.ANDESITE), 10, 33, 0, 80) });
    this.populators.add(ores);
}
Also used : Simplex(cn.nukkit.level.generator.noise.Simplex) BiomeSelector(cn.nukkit.level.generator.biome.BiomeSelector) OreType(cn.nukkit.level.generator.object.ore.OreType) NukkitRandom(cn.nukkit.math.NukkitRandom)

Aggregations

BiomeSelector (cn.nukkit.level.generator.biome.BiomeSelector)1 Simplex (cn.nukkit.level.generator.noise.Simplex)1 OreType (cn.nukkit.level.generator.object.ore.OreType)1 NukkitRandom (cn.nukkit.math.NukkitRandom)1