default int discoverCorner(int r) {
        if (!outsideCornerEdgeOpen(r)) return 0;
        IConnectable c = getCorner(r);
        if (c != null) {
            if ((c.canConnectCorner(rotFromCorner(r)) || canConnectCorner(r)) && canConnectPart(c, r) && c.connectCorner(this, rotFromCorner(r), -1)) {
                return setRenderFlag(c) ? 2 : 1;
            }
            return 0;
        }
        return discoverCornerOverride(absoluteDir(this, r)) ? 2 : 0;
    }
Tries to locate a corner connectable part towards r and establish a connection.

@param r The rotation towards the external corner part
@return True if connection was established
core/src/main/java/mrtjp/projectred/core/part/IConnectableFacePart.java