private Flagger getBoundaryFlagger(int x, int y, int plane, int type, int orientation, boolean flag,
	                                   boolean flag2) {
		FlagGroup group = new FlagGroup();
		int base = getBase(flag, flag2);
		switch (type) {
			case 0:
				int dir = ((orientation * 2 - 1) & 0x7);
				group.add(new DefinedFlagger(x, y, plane, base << dir));
				group.add(new DefinedFlagger(x + xoff(dir), y + yoff(dir), plane, base << flipDirection(dir)));
				break;
			case 1:
			case 3:
				dir = orientation << 1;
				group.add(new DefinedFlagger(x, y, plane, base << dir));
				group.add(new DefinedFlagger(x + xoff(dir), y + yoff(dir), plane, base << flipDirection(dir)));
				break;
			case 2:
				int dir1 = ((orientation << 1) + 1) & 0x7;
				int dir2 = ((orientation << 1) - 1) & 0x7;
				group.add(new DefinedFlagger(x, y, plane, base << (dir1 | dir2)));
				group.add(new DefinedFlagger(x + xoff(dir1), y + yoff(dir1), plane, base << flipDirection(dir1)));
				group.add(new DefinedFlagger(x + xoff(dir2), y + yoff(dir2), plane, base << flipDirection(dir2)));
				break;
		}
		return group;
	}