protected int getInput(int mask) {
        int input = 0;
        for (int r = 0; r < 4; r++) {
            if ((mask & 1 << r) != 0 && getRedstoneInput(r) > 0) {
                input |= 1 << r;
            }
        }
        return input;
    }
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