Update RecipeTransformer.java

This commit is contained in:
LLytho 2022-08-02 21:34:41 +02:00
parent 7fe1f6254f
commit 8d6f2e565a

View file

@ -15,7 +15,6 @@ import com.google.gson.JsonObject;
import com.google.gson.JsonPrimitive; import com.google.gson.JsonPrimitive;
import net.minecraft.resources.ResourceLocation; import net.minecraft.resources.ResourceLocation;
import javax.annotation.Nullable;
import java.util.*; import java.util.*;
import java.util.function.BiConsumer; import java.util.function.BiConsumer;
import java.util.function.Consumer; import java.util.function.Consumer;
@ -65,9 +64,9 @@ public class RecipeTransformer {
} else { } else {
transformRecipes(recipeLinks, recipes::put, recipes::remove); 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()); AlmostUnified.LOG.warn("Recipe counts afterwards: " + recipes.size());
return result; return result;
} }
@ -200,6 +199,10 @@ public class RecipeTransformer {
} }
} }
private void addAll(Collection<RecipeLink> links) {
links.forEach(this::add);
}
public Collection<RecipeLink> getRecipes(ResourceLocation type) { public Collection<RecipeLink> getRecipes(ResourceLocation type) {
return Collections.unmodifiableCollection(allRecipesByType.get(type)); return Collections.unmodifiableCollection(allRecipesByType.get(type));
} }