44import gregtech .api .capability .IEnergyContainer ;
55import gregtech .api .capability .impl .AbstractRecipeLogic ;
66import gregtech .api .capability .impl .ComputationRecipeLogic ;
7+ import gregtech .api .metatileentity .MetaTileEntity ;
78import gregtech .api .mui .GTByteBufAdapters ;
89import gregtech .api .mui .drawable .GTObjectDrawable ;
910import gregtech .api .recipes .Recipe ;
@@ -566,11 +567,16 @@ public MultiblockUIBuilder addRecipeOutputLine(AbstractRecipeLogic arl, int maxL
566567 RecipeMap <?> map = arl .getRecipeMap ();
567568 if (getSyncer ().syncBoolean (map == null )) return this ;
568569
570+ Recipe trimmed = null ;
571+ if (isServer ()) {
572+ MetaTileEntity mte = arl .getMetaTileEntity ();
573+ trimmed = Recipe .trimRecipeOutputs (recipe , map , mte .getItemOutputLimit (), mte .getFluidOutputLimit ());
574+ }
575+
569576 int p = getSyncer ().syncInt (arl .getParallelRecipesPerformed ());
570577 if (p == 0 ) p = 1 ;
571578
572- // noinspection DataFlowIssue
573- long eut = getSyncer ().syncLong (() -> recipe .getEUt ());
579+ long eut = getSyncer ().syncLong (trimmed == null ? 0 : trimmed .getEUt ());
574580 long maxVoltage = getSyncer ().syncLong (arl .getMaximumOverclockVoltage ());
575581 int maxProgress = getSyncer ().syncInt (arl .getMaxProgress ());
576582
@@ -583,11 +589,10 @@ public MultiblockUIBuilder addRecipeOutputLine(AbstractRecipeLogic arl, int maxL
583589
584590 if (isServer ()) {
585591 // recipe searching has to be done server only
586- // noinspection DataFlowIssue
587- itemOutputs .addAll (recipe .getOutputs ());
588- chancedItemOutputs .addAll (recipe .getChancedOutputs ().getChancedEntries ());
589- fluidOutputs .addAll (recipe .getFluidOutputs ());
590- chancedFluidOutputs .addAll (recipe .getChancedFluidOutputs ().getChancedEntries ());
592+ itemOutputs .addAll (trimmed .getOutputs ());
593+ chancedItemOutputs .addAll (trimmed .getChancedOutputs ().getChancedEntries ());
594+ fluidOutputs .addAll (trimmed .getFluidOutputs ());
595+ chancedFluidOutputs .addAll (trimmed .getChancedFluidOutputs ().getChancedEntries ());
591596 }
592597
593598 itemOutputs = getSyncer ().syncCollection (itemOutputs , ByteBufAdapters .ITEM_STACK );
0 commit comments