Examples of Mushroom


Examples of org.spout.vanilla.material.block.plant.Mushroom

    final int amount = getAmount(random);
    for (byte count = 0; count < amount; count++) {
      final int x = chunk.getBlockX(random);
      final int y = random.nextInt(NetherGenerator.HEIGHT);
      final int z = chunk.getBlockZ(random);
      final Mushroom mushroom = random.nextInt(4) == 0 ? VanillaMaterials.RED_MUSHROOM : VanillaMaterials.BROWN_MUSHROOM;
      for (byte size = 6; size > 0; size--) {
        final int xx = x - 7 + random.nextInt(15);
        final int zz = z - 7 + random.nextInt(15);
        final int yy = getHighestWorkableBlock(world, xx, y, zz);
        if (yy != -1 && world.getBlockMaterial(xx, yy, zz) == VanillaMaterials.AIR
            && mushroom.isValidPosition(world.getBlock(xx, yy, zz), BlockFace.BOTTOM, false)) {
          world.setBlockMaterial(xx, yy, zz, mushroom, (short) 0, null);
        }
      }
    }
  }
View Full Code Here

Examples of org.spout.vanilla.material.block.plant.Mushroom

    final int amount = getAmount(random);
    for (byte count = 0; count < amount; count++) {
      final int x = chunk.getBlockX(random);
      final int y = random.nextBoolean() ? NormalGenerator.HEIGHT - 1 : random.nextInt(64);
      final int z = chunk.getBlockZ(random);
      final Mushroom mushroom = random.nextInt(4) == 0 ? VanillaMaterials.RED_MUSHROOM : VanillaMaterials.BROWN_MUSHROOM;
      for (byte size = 6; size > 0; size--) {
        final int xx = x - 7 + random.nextInt(15);
        final int zz = z - 7 + random.nextInt(15);
        final int yy = getHighestWorkableBlock(world, xx, y, zz);
        if (yy != -1 && world.getBlockMaterial(xx, yy, zz) == VanillaMaterials.AIR
            && mushroom.isValidPosition(world.getBlock(xx, yy, zz), BlockFace.BOTTOM, false)) {
          world.setBlockMaterial(xx, yy, zz, mushroom, (short) 0, null);
        }
      }
    }
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.