File tree 1 file changed +16
-17
lines changed
src/main/java/com/simibubi/create/content/processing/basin
1 file changed +16
-17
lines changed Original file line number Diff line number Diff line change @@ -452,25 +452,24 @@ private void tryClearingSpoutputOverflow() {
452
452
continue ;
453
453
}
454
454
455
- if (targetInv == null )
456
- break ;
457
-
458
- long inserted = TransferUtil .insertItem (targetInv , itemStack );
459
- if (inserted == 0 )
460
- continue ;
461
- if (filter != null && !filter .test (itemStack ))
462
- continue ;
455
+ if (targetInv == null )
456
+ break ;
463
457
464
- if (visualizedOutputItems .size () < 3 )
465
- visualizedOutputItems .add (LongAttached .withZero (itemStack ));
466
- update = true ;
458
+ try (Transaction nested = t .openNested ()) {
459
+ long inserted = targetInv .insert (ItemVariant .of (itemStack ), itemStack .getCount (), nested );
460
+ if (itemStack .getCount () != inserted )
461
+ continue ;
462
+ if (filter != null && !filter .test (itemStack ))
463
+ continue ;
464
+
465
+ if (visualizedOutputItems .size () < 3 )
466
+ visualizedOutputItems .add (LongAttached .withZero (itemStack ));
467
+ update = true ;
467
468
468
- inserted = TransferUtil .insertItem (targetInv , itemStack .copy ());
469
- if (inserted == itemStack .getCount ())
470
- iterator .remove ();
471
- else
472
- itemStack .setCount ((int ) inserted );
473
- }
469
+ iterator .remove ();
470
+ nested .commit ();
471
+ }
472
+ }
474
473
475
474
for (Iterator <FluidStack > iterator = spoutputFluidBuffer .iterator (); iterator .hasNext ();) {
476
475
FluidStack fluidStack = iterator .next ();
You can’t perform that action at this time.
0 commit comments