Fix out of order bug (#21)

This commit is contained in:
Joshua Ball authored and GitHub committed 2024-12-09 13:16:47 -06:00
1 parent b069425613
commit e852c84cef
12 files changed
+1108 -228

No files matched your search

@@ -22,6 +22,7 @@ import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import me.towdium.jecalculation.data.label.ILabel;
import me.towdium.jecalculation.data.structure.CostList;
import me.towdium.jecalculation.data.structure.MainCostListService;
import me.towdium.jecalculation.data.structure.Recipe;
import me.towdium.jecalculation.gui.JecaGui;
import me.towdium.jecalculation.gui.guis.GuiRecipe;
@@ -83,17 +84,20 @@ public class JecaOverlayHandler implements IOverlayHandler {
dst.computeIfAbsent(type, i -> new ArrayList<>())
.stream()
.filter(p -> {
CostList cl = new CostList(list);
CostList cl = MainCostListService.INSTANCE.newNegatedCostList(list);
if (p.three.equals(cl)) {
ILabel.MERGER.merge(p.one, fin)
.ifPresent(i -> p.one = i);
p.two = CostList.merge(p.two, cl, true);
p.two = MainCostListService.INSTANCE.strictMergeCostList(p.two, cl);
return true;
} else return false;
})
.findAny()
.orElseGet(() -> {
Trio<ILabel, CostList, CostList> ret = new Trio<>(fin, new CostList(list), new CostList(list));
Trio<ILabel, CostList, CostList> ret = new Trio<>(
fin,
MainCostListService.INSTANCE.newNegatedCostList(list),
MainCostListService.INSTANCE.newNegatedCostList(list));
dst.get(type)
.add(ret);
return ret;