@Override
public boolean generate(World world, Random rand, BlockPos pos) {
if(!aircheck(world, rand, pos))
return false;
for (int xx = - radius; xx <= radius; xx++) {
for (int zz = - radius; zz <= radius; zz++) {
for (int yy = 0; yy < height; yy++) {
double dSqDome = Math.pow(xx, 2.0D) + Math.pow(zz, 2.0D) + Math.pow(yy, 2.0D);
if (yy == 0 && rand.nextBoolean() && Math.round(Math.sqrt(dSqDome)) == 5)
world.setBlockState(pos.add(xx, -1, zz), DUNG, 2);
if (Math.round(Math.sqrt(dSqDome)) < 5)
world.setBlockState(pos.add(xx, yy, zz), DUNG, 2);
}
if (rand.nextInt(5) == 0)
world.setBlockState(pos.add(xx, 0, zz), DUNG, 2);
}
}
world.setBlockState(pos, Blocks.CHEST.getStateFromMeta(0), 2);
TileEntityChest chest = (TileEntityChest) world.getTileEntity(pos);
if (chest != null)
LootUtil.generateLoot(chest, rand, CHEST_LOOT, 8, 14);
world.setBlockState(pos.add(-1, 1, 1), ModBlocks.DUNG_SPAWNER_BOT_FLY.getDefaultState(), 2);
world.setBlockState(pos.add(1, 1, 1), ModBlocks.DUNG_SPAWNER_FLY.getDefaultState(), 2);
world.setBlockState(pos.add(1, 1, -1), ModBlocks.DUNG_SPAWNER_BOT_FLY.getDefaultState(), 2);
world.setBlockState(pos.add(-1, 1, -1), ModBlocks.DUNG_SPAWNER_FLY.getDefaultState(), 2);
world.setBlockState(pos.add(0, height, 0), ModBlocks.DUNG_SPAWNER_FLY.getDefaultState(), 2);
return true;
}