Search in sources :

Example 1 with Simplex

use of cn.nukkit.level.generator.noise.Simplex in project Nukkit by Nukkit.

the class Nether 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.noiseBase = new Simplex(this.nukkitRandom, 4, 1 / 4f, 1 / 64f);
    this.nukkitRandom.setSeed(this.level.getSeed());
    this.localSeed1 = this.random.nextLong();
    this.localSeed2 = this.random.nextLong();
    PopulatorOre ores = new PopulatorOre(Block.NETHERRACK);
    ores.setOreTypes(new OreType[] { new OreType(new BlockOreQuartz(), 20, 16, 0, 128), new OreType(new BlockSoulSand(), 5, 64, 0, 128), new OreType(new BlockGravel(), 5, 64, 0, 128), new OreType(new BlockLava(), 1, 16, 0, (int) this.waterHeight) });
    this.populators.add(ores);
    this.populators.add(new PopulatorGlowStone());
    PopulatorGroundFire groundFire = new PopulatorGroundFire();
    groundFire.setBaseAmount(1);
    groundFire.setRandomAmount(1);
    this.populators.add(groundFire);
    PopulatorLava lava = new PopulatorLava();
    lava.setBaseAmount(0);
    lava.setRandomAmount(2);
    this.populators.add(lava);
}
Also used : Simplex(cn.nukkit.level.generator.noise.Simplex) OreType(cn.nukkit.level.generator.object.ore.OreType) NukkitRandom(cn.nukkit.math.NukkitRandom)

Example 2 with Simplex

use of cn.nukkit.level.generator.noise.Simplex 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

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