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);
}
}
}