if (chunk.getY() != 4) {
return;
}
final World world = chunk.getWorld();
for (OreType oreType : oreTypes) {
final OreObject ore = new OreObject(oreType);
ore.setRandom(random);
for (byte i = 0; i < oreType.getClusterCount(); i++) {
final int x = chunk.getBlockX(random);
final int y = random.nextInt(oreType.getMaxHeight() - oreType.getMinHeight())
+ oreType.getMinHeight();
final int z = chunk.getBlockZ(random);
if (ore.canPlaceObject(world, x, y, z)) {
ore.placeObject(world, x, y, z);
}
}
}
}