protected int getRedstoneInput(int r) {
        int ar = toAbsolute(r);

        FaceLookup lookup = null;
        if (maskConnectsCorner(ar)) {
            lookup = FaceLookup.lookupCorner(level(), pos(), getSide(), ar);
        } else if (maskConnectsStraight(ar)) {
            lookup = FaceLookup.lookupStraight(level(), pos(), getSide(), ar);
        } else if (maskConnectsInside(ar)) {
            lookup = FaceLookup.lookupInsideFace(level(), pos(), getSide(), ar);
        }

        if (lookup != null) {
            return RedstoneFaceLookup.resolveSignal(lookup, false);
        }

        // Vanilla signal resolution
        lookup = FaceLookup.lookupStraight(level(), pos(), getSide(), ar);
        return RedstoneFaceLookup.resolveVanillaSignal(lookup, this, true, false);
    }
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