for(int k = 2; k >= -2; k--) {
int x = par4 + i + 1;
int y = par5 + k + 1;
int z = par6 + j + 1;
if(par3World.isAirBlock(x, y, z) && (!par3World.provider.hasNoSky || y < 255) && ModBlocks.flower.canBlockStay(par3World, x, y, z))
validCoords.add(new ChunkCoordinates(x, y, z));
}
}
int flowerCount = Math.min(validCoords.size(), par3World.rand.nextBoolean() ? 3 : 4);
for(int i = 0; i < flowerCount; i++) {
ChunkCoordinates coords = validCoords.get(par3World.rand.nextInt(validCoords.size()));
validCoords.remove(coords);
par3World.setBlock(coords.posX, coords.posY, coords.posZ, ModBlocks.flower, par3World.rand.nextInt(16), 1 | 2);
}
par1ItemStack.stackSize--;
} else {