Потом скину код, щас не могу.volt написал(а):Спасибо. А как окружность построить?:angel:
@Override
public boolean onItemUse(ItemStack is, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ) {
int height = 16;
int height2 = height / 2;
for (int h = 0; h <= height; ++h) {
for (int rx = -(height2 - h); rx <= (height2 - h); ++rx) {
for (int rz = -(height2 - h); rz <= (height2 - h); ++rz) {
if (world.isAirBlock(x + rx, y + h, z + rz))
world.setBlock(x + rx, y + h, z + rz, Blocks.stone);
}
}
}
return true;
}
@Override
public boolean onItemUse(ItemStack is, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ) {
int radius = 8;
for (int rx = x - radius; rx <= x + radius; ++rx) {
for (int ry = y - radius; ry <= y + radius; ++ry) {
for (int rz = z - radius; rz <= z + radius; ++rz) {
if (world.isAirBlock(rx, ry, rz) && distanceTo(x, y, z, rx, ry, rz) <= radius)
world.setBlock(rx, ry, rz, Blocks.stone);
}
}
}
return true;
}
public int distanceTo(int xa, int ya, int za, int bx, int yb, int zb) {
double d0 = (xa + 0.5D) - (bx + 0.5D);
double d1 = (ya + 0.5D) - (yb + 0.5D);
double d2 = (za + 0.5D) - (zb + 0.5D);
return (int)Math.sqrt(d0 * d0 + d1 * d1 + d2 * d2);
}
if (world.isAirBlock(rx, ry, rz) && distanceTo(x, y, z, rx, ry, rz) <= radius)
if (world.isAirBlock(rx, ry, rz) && distanceTo(x, y, z, rx, ry, rz) == radius)
if (world.isAirBlock(x + rx, y + h, z + rz))
if (world.isAirBlock(x + rx, y + h, z + rz) && ((rx == -(height2 - h) || rx == (height2 - h)) || (rz == -(height2 - h) || rz == (height2 - h))))