From b6e47b972aa109704e9ce0fc29934452e6e94bbe Mon Sep 17 00:00:00 2001 From: NotAPenguin Date: Mon, 19 Aug 2024 08:49:27 +0200 Subject: Fix laser engraver recipemap comparator (#2924) * Fix laser engraver comparator * debug: use no custom comparator for laser map (do not merge this commit) * Revert "debug: use no custom comparator for laser map (do not merge this commit)" This reverts commit ffc66689f301294f1c4d210a2928ec9a367d4961. --------- Co-authored-by: Martin Robertz --- src/main/java/gregtech/api/recipe/RecipeMaps.java | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) (limited to 'src/main/java/gregtech/api') diff --git a/src/main/java/gregtech/api/recipe/RecipeMaps.java b/src/main/java/gregtech/api/recipe/RecipeMaps.java index 2c05eb0e08..2ced6fab57 100644 --- a/src/main/java/gregtech/api/recipe/RecipeMaps.java +++ b/src/main/java/gregtech/api/recipe/RecipeMaps.java @@ -290,21 +290,10 @@ public final class RecipeMaps { (index, isFluid, isOutput, isSpecial) -> !isFluid && !isOutput && index != 0 ? GT_UITextures.OVERLAY_SLOT_LENS : null) // Add a simple ordering so lower tier purified water is displayed first, otherwise it gets really confusing - .neiRecipeComparator((a, b) -> { - // Find lens, if no lens was present we can use the default comparator - if (a.mInputs.length > 1 && b.mInputs.length > 1) { - ItemStack firstLens = a.mInputs[1]; - ItemStack secondLens = b.mInputs[1]; - // Find purified water/any fluid, if none was present simply use the lens to compare - if (ItemStack.areItemStacksEqual(firstLens, secondLens) && a.mFluidInputs.length > 0 - && b.mFluidInputs.length > 0) { - return Comparator - .comparing(r -> PurifiedWaterHelpers.getWaterTier(r.mFluidInputs[0])) - .compare(a, b); - } - } - return a.compareTo(b); - }) + .neiRecipeComparator( + (a, b) -> Comparator.comparing(PurifiedWaterHelpers::getWaterTierFromRecipe) + .thenComparing(GT_Recipe::compareTo) + .compare(a, b)) .build(); public static final RecipeMap mixerRecipes = RecipeMapBuilder.of("gt.recipe.mixer") .maxIO(9, 4, 1, 1) -- cgit