Skip to content

Instantly share code, notes, and snippets.

@superckl
Last active August 29, 2015 14:05
Show Gist options
  • Save superckl/6d444c46eab2558dfab2 to your computer and use it in GitHub Desktop.
Save superckl/6d444c46eab2558dfab2 to your computer and use it in GitHub Desktop.
Oval gen
int Ewidth = 4;
int Eheight = 3;
ElipseHelper helper = new ElipseHelper((float) vec.xCoord, (float) vec.zCoord, Ewidth, Eheight);
if(random.nextBoolean()){
helper.setSwapXY(true);
Ewidth = (int) helper.getAxis2();
Eheight = (int) helper.getAxis1();
}
int x = (int) vec.xCoord;
int y = (int) vec.yCoord;
int z = (int) vec.zCoord;
for(int i = 0; i < Ewidth; i++)
for(int j = 0; j < Eheight; j++)
if(world.getBlock(x+i, y, z+j) == ModBlocks.hardCoral && helper.isInside(x+i, z+j))
world.setBlockMetadataWithNotify(x+i, y, z+j, 1, 2);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment