public static byte calcBorderTypeByTileTypeEdges(Tile tile, Point[] surrPoints, boolean biome) {
		Tile[] sTiles = Utils.surroundingPointsToTiles(surrPoints);
		if (sTiles.length == 8) {
			if (!isDifferent(sTiles[0], tile, biome) && isDifferent(sTiles[1], tile, biome) && isDifferent(sTiles[2], tile, biome) && isDifferent(sTiles[3], tile, biome)) {
				return Borders.UP_EMPTY;
			} else if (!isDifferent(sTiles[1], tile, biome) && isDifferent(sTiles[0], tile, biome) && isDifferent(sTiles[2], tile, biome) && isDifferent(sTiles[3], tile, biome)) {
				return Borders.RIGHT_EMPTY;
			} else if (!isDifferent(sTiles[2], tile, biome) && isDifferent(sTiles[1], tile, biome) && isDifferent(sTiles[0], tile, biome) && isDifferent(sTiles[3], tile, biome)) {
				return Borders.DOWN_EMPTY;
			} else if (!isDifferent(sTiles[3], tile, biome) && isDifferent(sTiles[1], tile, biome) && isDifferent(sTiles[2], tile, biome) && isDifferent(sTiles[0], tile, biome)) {
				return Borders.LEFT_EMPTY;
			} else if (!(isDifferent(sTiles[0], tile, biome) && isDifferent(sTiles[2], tile, biome)) && isDifferent(sTiles[1], tile, biome) && isDifferent(sTiles[3], tile, biome)) {
				return Borders.UD_EMPTY;
			} else if (!(isDifferent(sTiles[1], tile, biome) && isDifferent(sTiles[3], tile, biome)) && isDifferent(sTiles[0], tile, biome) && isDifferent(sTiles[2], tile, biome)) {
				return Borders.LR_EMPTY;
			} else if (allDifferent(tile, sTiles, biome)) {
				return Borders.SURROUNDED;
			} else if (isDifferent(sTiles[0], tile, biome) && isDifferent(sTiles[3], tile, biome) && !(isDifferent(sTiles[1], tile, biome) && isDifferent(sTiles[2], tile, biome))) {
				return Borders.UP_LEFT;
			} else if (isDifferent(sTiles[0], tile, biome) && isDifferent(sTiles[1], tile, biome) && !(isDifferent(sTiles[3], tile, biome) && isDifferent(sTiles[2], tile, biome))) {
				return Borders.UP_RIGHT;
			} else if (isDifferent(sTiles[2], tile, biome) && isDifferent(sTiles[1], tile, biome) && !(isDifferent(sTiles[0], tile, biome) && isDifferent(sTiles[3], tile, biome))) {
				return Borders.DOWN_RIGHT;
			} else if (isDifferent(sTiles[2], tile, biome) && isDifferent(sTiles[3], tile, biome) && !(isDifferent(sTiles[1], tile, biome) && isDifferent(sTiles[0], tile, biome))) {
				return Borders.DOWN_LEFT;
			} else if (isDifferent(sTiles[2], tile, biome) && !(isDifferent(sTiles[0], tile, biome) && isDifferent(sTiles[1], tile, biome) && isDifferent(sTiles[3], tile, biome))) {
				return Borders.DOWN;
			} else if (isDifferent(sTiles[0], tile, biome) && !(isDifferent(sTiles[1], tile, biome) && isDifferent(sTiles[2], tile, biome) && isDifferent(sTiles[3], tile, biome))) {
				return Borders.UP;
			} else if (isDifferent(sTiles[1], tile, biome) && !(isDifferent(sTiles[0], tile, biome) && isDifferent(sTiles[2], tile, biome) && isDifferent(sTiles[3], tile, biome))) {
				return Borders.RIGHT;
			} else if (isDifferent(sTiles[3], tile, biome) && !(isDifferent(sTiles[1], tile, biome) && isDifferent(sTiles[2], tile, biome) && isDifferent(sTiles[0], tile, biome))) {
				return Borders.LEFT;
			} 
		}
		
		return 0;
	}