So I wrote a circle generator that I thought others might find useful. You can find it in my Github repo. You should be able to copy the class into your own projects and use it right away.
It can generate both normal circles and filled circles. It uses a custom Callable class so you can specify what you want to generate at each point in the circle.
Examples of Use
Circle.generate(x, z, 7, new CircleCallback()
{
public void call(int x1, int z1)
{
for(int y = mWorld.getTopSolidOrLiquidBlock(x1, z1); y < 100; ++y)
{
mWorld.setBlock(x1, y, z1, 98);
}
}
});
The above code generates a tower with a radius of 7 blocks on the surface that goes up to y=100. You can see the result here.
Circle.generateFilled(x, z, 8, new CircleCallback()
{
public void call(int x1, int z1)
{
mWorld.setBlock(x1, 90, z1, 22);
}
});
This code generates lapis lazuli discs at y=90. This is the result.
If you're interested you can check out how I wrote it at my blog.
Hope you find it useful and let me know what you think!
EDIT: Changed the name of the callback from GenerateBlock to CircleCallback
It can generate both normal circles and filled circles. It uses a custom Callable class so you can specify what you want to generate at each point in the circle.
Examples of Use
The above code generates a tower with a radius of 7 blocks on the surface that goes up to y=100. You can see the result here.
This code generates lapis lazuli discs at y=90. This is the result.
If you're interested you can check out how I wrote it at my blog.
Hope you find it useful and let me know what you think!
EDIT: Changed the name of the callback from GenerateBlock to CircleCallback
This generates lapis lazuli spheres.