LinkedList<BlockIndex> res = new LinkedList<BlockIndex>();
TilePathMarker nextTile = this;
while (nextTile != null) {
BlockIndex b = new BlockIndex(nextTile.xCoord, nextTile.yCoord, nextTile.zCoord);
visitedPaths.add(b);
res.add(b);
if (nextTile.links[0] != null
&& !visitedPaths.contains(new BlockIndex(nextTile.links[0].xCoord, nextTile.links[0].yCoord, nextTile.links[0].zCoord))) {
nextTile = nextTile.links[0];
} else if (nextTile.links[1] != null
&& !visitedPaths.contains(new BlockIndex(nextTile.links[1].xCoord, nextTile.links[1].yCoord, nextTile.links[1].zCoord))) {
nextTile = nextTile.links[1];
} else {
nextTile = null;
}
}