public static void generateEllipsoid(World world, Location center, int width1, int width2, int depth, Material material) {
int a = width1 / 2;
int b = width2 / 2;
int c = depth / 2;
for (int x = -a; x <= a; x++) {
for (int y = -b; y <= b; y++) {
for (int z = -c; z <= c; z++) {
double distance = ((double) x / a) * ((double) x / a) + ((double) y / b) * ((double) y / b) + ((double) z / c) * ((double) z / c);
if (distance <= 1) {
Location loc = center.clone().add(x, y, z);
world.getBlockAt(loc).setType(material);
}
}
}
}
}