@Override
    public void notifyExternals(int mask) {
        int smask = 0;

        for (int r = 0; r < 4; r++) {
            if ((mask & 1 << r) == 0) continue;
            int absSide = absoluteDir(r);
            BlockPos pos2 = pos().relative(Direction.values()[absSide]);

            level().neighborChanged(pos2, CBMultipartModContent.MULTIPART_BLOCK.get(), pos());
            for (int s = 0; s < 6; s++) {
                if (s != (absSide ^ 1) && (smask & 1 << s) == 0) {
                    level().neighborChanged(
                            pos2.relative(Direction.values()[s]), CBMultipartModContent.MULTIPART_BLOCK.get(), pos2);
                }
            }
            smask |= 1 << absSide;
        }
    }
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