diff --git a/Common/src/main/java/com/almostreliable/unified/recipe/RecipeTransformer.java b/Common/src/main/java/com/almostreliable/unified/recipe/RecipeTransformer.java index 9b89b8b..859153e 100644 --- a/Common/src/main/java/com/almostreliable/unified/recipe/RecipeTransformer.java +++ b/Common/src/main/java/com/almostreliable/unified/recipe/RecipeTransformer.java @@ -116,7 +116,7 @@ public class RecipeTransformer { * @param tracker The tracker to add the recipes to. Can be null in a server only environment. */ private void transformRecipes(List recipeLinks, Map allRecipes, @Nullable ClientRecipeTracker.RawBuilder tracker) { - var unified = unifyRecipes(recipeLinks, (r) -> allRecipes.put(r.getId(), r.getUnified())); + var unified = unifyRecipes(recipeLinks, r -> allRecipes.put(r.getId(), r.getUnified())); var duplicates = handleDuplicates(duplicationConfig.isStrictMode() ? recipeLinks : unified, recipeLinks); duplicates .stream() @@ -131,6 +131,7 @@ public class RecipeTransformer { .stream() .filter(entry -> includeRecipe(entry.getKey(), entry.getValue())) .map(entry -> new RecipeLink(entry.getKey(), entry.getValue().getAsJsonObject())) + .sorted(Comparator.comparing(entry -> entry.getId().toString())) .collect(Collectors.groupingByConcurrent(RecipeLink::getType)); } @@ -192,8 +193,8 @@ public class RecipeTransformer { * @param onUnified A consumer that will be called on each unified recipe. * @return A list of unified recipes. */ - private Set unifyRecipes(List recipeLinks, Consumer onUnified) { - Set unified = new HashSet<>(recipeLinks.size()); + private LinkedHashSet unifyRecipes(List recipeLinks, Consumer onUnified) { + LinkedHashSet unified = new LinkedHashSet<>(recipeLinks.size()); for (RecipeLink recipeLink : recipeLinks) { unifyRecipe(recipeLink); if (recipeLink.isUnified()) {