fix: *correctly* handly empty ingredients

This commit is contained in:
LordMZTE 2023-11-24 19:00:31 +01:00
parent bd494d7707
commit ae42a1a04c
Signed by: LordMZTE
GPG key ID: B64802DC33A64FF6

View file

@ -84,7 +84,7 @@ public class ShapedRecipeBuilder {
DefaultedList<Ingredient> ingredients = DefaultedList.of();
Arrays.stream(this.pattern)
.flatMap(s -> s.chars().mapToObj(c -> (char) c))
.map(this.ingredients::get)
.map(k -> this.ingredients.getOrDefault(k, Ingredient.empty()))
.forEach(ingredients::add);
return new ShapedRecipe(