diff options
author | NotAPenguin <michiel.vandeginste@gmail.com> | 2024-08-19 08:49:27 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-08-19 08:49:27 +0200 |
commit | b6e47b972aa109704e9ce0fc29934452e6e94bbe (patch) | |
tree | 0f0849c0c4b615d656b8bf2f40a423a33847dcda /src/main/java/gregtech/api | |
parent | 76f36fdb49b49539a8211ba3bcf85339f143943b (diff) | |
download | GT5-Unofficial-b6e47b972aa109704e9ce0fc29934452e6e94bbe.tar.gz GT5-Unofficial-b6e47b972aa109704e9ce0fc29934452e6e94bbe.tar.bz2 GT5-Unofficial-b6e47b972aa109704e9ce0fc29934452e6e94bbe.zip |
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 <dream-master@gmx.net>
Diffstat (limited to 'src/main/java/gregtech/api')
-rw-r--r-- | src/main/java/gregtech/api/recipe/RecipeMaps.java | 19 |
1 files changed, 4 insertions, 15 deletions
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 - .<GT_Recipe, Integer>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<RecipeMapBackend> mixerRecipes = RecipeMapBuilder.of("gt.recipe.mixer") .maxIO(9, 4, 1, 1) |