return;
}
if (random.nextInt(odd) != 0) {
return;
}
final World world = chunk.getWorld();
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);
}
}
}
}