protected boolean gateLogicCanConnect(int r) {
        int ioMask = outputMask(shape()) | inputMask(shape());
        return ((ioMask) & 1 << r) != 0;
    }
Mapped inputs and outputs of the gate.
OOOO IIII
High nybble is output.
Low nybble is input
integration/src/main/java/mrtjp/projectred/integration/part/RedstoneGatePart.java