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

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


      }
      if (GenericMath.getRandom().nextDouble() < 0.4D) {
        final BlockMaterial mushroomType = block.getMaterial();
        final VariableHeightObject mushroom;
        if (mushroomType == VanillaMaterials.RED_MUSHROOM) {
          mushroom = new HugeMushroomObject(HugeMushroomType.RED);
        } else {
          mushroom = new HugeMushroomObject(HugeMushroomType.BROWN);
        }
        final World world = block.getWorld();
        final int x = block.getX();
        final int y = block.getY();
        final int z = block.getZ();
View Full Code Here


  public void populate(Chunk chunk, Random random) {
    if (chunk.getY() != 4) {
      return;
    }
    final World world = chunk.getWorld();
    final HugeMushroomObject mushroom;
    if (random.nextBoolean()) {
      mushroom = new HugeMushroomObject(HugeMushroomType.RED);
    } else {
      mushroom = new HugeMushroomObject(HugeMushroomType.BROWN);
    }
    mushroom.setRandom(random);
    final int amount = getAmount(random);
    for (byte count = 0; count < amount; count++) {
      final int x = chunk.getBlockX(random);
      final int z = chunk.getBlockZ(random);
      final int y = getHighestWorkableBlock(world, x, z);
      mushroom.randomize();
      if (y != -1 && mushroom.canPlaceObject(world, x, y, z)) {
        mushroom.placeObject(world, x, y, z);
      }
    }
  }
View Full Code Here

TOP

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

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.