From 8d6f2e565a6882804be29031bdc80fb1ee5c8fec Mon Sep 17 00:00:00 2001 From: LLytho <29131229+LLytho@users.noreply.github.com> Date: Tue, 2 Aug 2022 21:34:41 +0200 Subject: [PATCH] Update RecipeTransformer.java --- .../almostreliable/unified/recipe/RecipeTransformer.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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 030d190..f0165fb 100644 --- a/Common/src/main/java/com/almostreliable/unified/recipe/RecipeTransformer.java +++ b/Common/src/main/java/com/almostreliable/unified/recipe/RecipeTransformer.java @@ -15,7 +15,6 @@ import com.google.gson.JsonObject; import com.google.gson.JsonPrimitive; import net.minecraft.resources.ResourceLocation; -import javax.annotation.Nullable; import java.util.*; import java.util.function.BiConsumer; import java.util.function.Consumer; @@ -65,9 +64,9 @@ public class RecipeTransformer { } else { transformRecipes(recipeLinks, recipes::put, recipes::remove); } + result.addAll(recipeLinks); }); - byType.values().stream().flatMap(Collection::stream).forEach(result::add); AlmostUnified.LOG.warn("Recipe counts afterwards: " + recipes.size()); return result; } @@ -200,6 +199,10 @@ public class RecipeTransformer { } } + private void addAll(Collection links) { + links.forEach(this::add); + } + public Collection getRecipes(ResourceLocation type) { return Collections.unmodifiableCollection(allRecipesByType.get(type)); }