Applied Energistics 2

Applied Energistics 2

137M Downloads

Encoded Processing Pattern with Duplicate Outputs is Invalid

shartte opened this issue ยท 2 comments

commented

The following pattern can be encoded, but it is invalid due to the two outputs being the same:

grafik
grafik

commented

It's actually being merged into one stack when the pattern is decoded, but then it can't find the primary output anymore with exactly the same amount leading to this problem.

This might have been a bug introduced by my refactor. See this block from AEProcessingPattern. The comment doesn't match the actual code, and "smaller stack size" also just seems wrong? Shouldn't it be "larger stack size", in case it got merged with secondary outputs?

        // Ensure the primary output is the first in the list, even if it has a smaller stack size.
        int primaryOutputIndex = -1;
        for (int i = 0; i < condensedOutputs.length; ++i) {
            if (primaryOutput.equals(condensedOutputs[i])) {
                primaryOutputIndex = i;
            }
        }
commented

I'm not sure having two identical outputs is a good thing? Would need to check that it's handled correctly.