Package org.spout.vanilla.world.generator.normal.object

Examples of org.spout.vanilla.world.generator.normal.object.BlockPatchObject


  public void populate(Chunk chunk, Random random) {
    if (chunk.getY() != 4) {
      return;
    }
    final World world = chunk.getWorld();
    final BlockPatchObject sand = new BlockPatchObject(VanillaMaterials.SAND);
    sand.setRandom(random);
    for (byte count = 0; count < firstSandAmount; count++) {
      final int x = chunk.getBlockX(random);
      final int z = chunk.getBlockZ(random);
      final int y = getHighestWorkableBlock(world, x, z);
      sand.randomize();
      if (y != -1 && sand.canPlaceObject(world, x, y, z)) {
        sand.placeObject(world, x, y, z);
      }
    }
    final BlockPatchObject clay = new BlockPatchObject(VanillaMaterials.CLAY_BLOCK);
    clay.setHeightRadius((byte) 1);
    clay.getOverridableMaterials().clear();
    clay.getOverridableMaterials().add(VanillaMaterials.DIRT);
    clay.setRandom(random);
    for (byte count = 0; count < clayAmount; count++) {
      final int x = chunk.getBlockX(random);
      final int z = chunk.getBlockZ(random);
      final int y = getHighestWorkableBlock(world, x, z);
      clay.randomize();
      if (y != -1 && clay.canPlaceObject(world, x, y, z)) {
        clay.placeObject(world, x, y, z);
      }
    }
    for (byte count = 0; count < secondSandAmount; count++) {
      final int x = chunk.getBlockX(random);
      final int z = chunk.getBlockZ(random);
View Full Code Here

TOP

Related Classes of org.spout.vanilla.world.generator.normal.object.BlockPatchObject

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.