@@ -89,8 +89,9 @@ public void supplementaryOutput(CallbackInfo ci, @Share("rcOutput") LocalLongRef
8989
9090 if (repeatInput .getStackSize () > 0 ) {
9191 var size = Math .min (out , repeatInput .getStackSize ());
92- tree .getUsed ().add (this .output .copy ().setStackSize (size ));
93- r$wait = this .output .copy ().setStackSize (repeatInput .getStackSize () - size );
92+ tree .getUsed ().add (repeatOutput .setStackSize (size ));
93+ repeatInput .decStackSize (size );
94+ r$wait = repeatInput ;
9495 }
9596 break ;
9697 }
@@ -102,8 +103,7 @@ public void supplementaryOutput(CallbackInfo ci, @Share("rcOutput") LocalLongRef
102103 repeatInput .incStackSize (input .getStackSize ());
103104 }
104105 }
105- final var inputSize = repeatInput .getStackSize ();
106- if (inputSize == 0 ) return ;
106+ if (repeatInput .getStackSize () == 0 ) return ;
107107
108108 IAEItemStack repeatOutput = this .output .copy ().setStackSize (0 );
109109 for (var input : details .getCondensedOutputs ()) {
@@ -115,10 +115,9 @@ public void supplementaryOutput(CallbackInfo ci, @Share("rcOutput") LocalLongRef
115115
116116 long outputQuantity = this .output .getStackSize () / repeatOutput .getStackSize ();
117117 if (this .output .getStackSize () % repeatOutput .getStackSize () != 0 ) ++outputQuantity ;
118- repeatInput .setStackSize (repeatInput .getStackSize () * outputQuantity + inputSize );
119118
120- tree .setHowManyEmitted (inputSize );
121- r$wait = this . output . copy (). setStackSize (repeatInput .getStackSize ());
119+ tree .setHowManyEmitted (repeatInput . getStackSize () );
120+ r$wait = repeatInput . setStackSize (repeatInput .getStackSize () * ++ outputQuantity );
122121 setSpecialDeficiency (true );
123122 }
124123 }
0 commit comments