Package org.bukkit.util.noise

Examples of org.bukkit.util.noise.SimplexNoiseGenerator


*/
public class DungeonPopulator extends BlockPopulator {

    @Override
    public void populate(World world, Random random, Chunk source) {
        SimplexNoiseGenerator noise = new SimplexNoiseGenerator(world);
        ChunkSnapshot snapshot = source.getChunkSnapshot();

        // Randomly turn exposed stone to treasure
        for (int x = 0; x < 16; x++) {
            for (int z = 0; z < 16; z++) {
                int y = snapshot.getHighestBlockYAt(x, z);
                Block block = source.getBlock(x, y - 1, z);

                if (block.getType() == Material.STONE
                        && random.nextInt(1024) == 0) {
                    placeChest(random, block);
                }
            }
        }

        // Go go dungeons
        double density = noise.noise(source.getX(), source.getZ());
        if (density > 0.8) {
            int roomCount = (int) (density * 10) - 3;

            for (int i = 0; i < roomCount; i++) {
                if (random.nextBoolean()) {
View Full Code Here


  public ShapeProvider(WorldGenerator generator, Odds odds) {
    super();
    this.odds = odds;
    long seed = generator.getWorldSeed();
   
    macroShape = new SimplexNoiseGenerator(seed + 2);
    microShape = new SimplexNoiseGenerator(seed + 3);
   
  }
View Full Code Here

    noiseShape.setScale(noiseHorizontalScale);
    featureShape = new SimplexOctaveGenerator(seed + 4, 2);
    featureShape.setScale(featureHorizontalScale);
   
//    caveShape = new SimplexNoiseGenerator(seed);
    ecoShape = new SimplexNoiseGenerator(seed + 5);
   
    // get ranges
    height = world.getMaxHeight();
    seaLevel = world.getSeaLevel();
    landRange = height - seaLevel - fudgeVerticalScale + landFlattening;
View Full Code Here

  public ShapeProvider_Floating(WorldGenerator generator, Odds odds) {
    super(generator, odds);
    long seed = generator.getWorldSeed();
   
    terrainShape = new SimplexNoiseGenerator(seed + 3);
    noiseShape = new SimplexNoiseGenerator(seed + 4);
   
    //streetLevel = height / 8 * 3;
    constructMin = seaLevel + landRange + 32;
    constructRange = height - 32 - constructMin;
  }
View Full Code Here

    noiseShape = new SimplexOctaveGenerator(seed + 3, 16);
    noiseShape.setScale(noiseHorizontalScale);
    featureShape = new SimplexOctaveGenerator(seed + 4, 2);
    featureShape.setScale(featureHorizontalScale);
   
    caveShape = new SimplexNoiseGenerator(seed);
    mineShape = new SimplexNoiseGenerator(seed + 1);
   
    // get ranges
    height = world.getMaxHeight();
    seaLevel = world.getSeaLevel();
    landRange = height - seaLevel - fudgeVerticalScale + landFlattening;
View Full Code Here

TOP

Related Classes of org.bukkit.util.noise.SimplexNoiseGenerator

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.