public CuboidCoord setSide(int s, int v) { switch (s) { case 0: min.y = v; break; case 1: max.y = v; break; case 2: min.z = v; break; case 3: max.z = v; break; case 4: min.x = v; break; case 5: max.x = v; break; default: throw new IndexOutOfBoundsException("Switch Falloff"); } return this; }
public CuboidCoord include(int x, int y, int z) { if (x < min.x) min.x = x; else if (x > max.x) max.x = x; if (y < min.y) min.y = y; else if (y > max.y) max.y = y; if (z < min.z) min.z = z; else if (z > max.z) max.z = z; return this; }
public CuboidCoord expand(int side, int amount) { if (side % 2 == 0) // negative side min = min.offset(side, amount); else max = max.offset(side, amount); return this; }
public CuboidCoord expand(int x, int y, int z) { max.add(x, y, z); min.sub(x, y, z); return this; }
public CuboidCoord(BlockCoord coord) { this(coord, coord.copy()); }
public CuboidCoord set(BlockCoord coord) { min.set(coord); max.set(coord); return this; }
public CuboidCoord set(int x1, int y1, int z1, int x2, int y2, int z2) { min.set(x1, y1, z1); max.set(x2, y2, z2); return this; }
public CuboidCoord copy() { return new CuboidCoord(min.copy(), max.copy()); }
public BlockCoord getCenter(BlockCoord store) { store.set( min.x + (max.x - min.x) / 2, min.y + (max.y - min.y) / 2, min.z + (max.z - min.z) / 2); return store; }