diff --git a/src/main/java/dev/ftb/mods/ftbjeiextras/modspecific/GlodiumHelpers.java b/src/main/java/dev/ftb/mods/ftbjeiextras/modspecific/GlodiumHelpers.java index 7163d0f..840f0ac 100644 --- a/src/main/java/dev/ftb/mods/ftbjeiextras/modspecific/GlodiumHelpers.java +++ b/src/main/java/dev/ftb/mods/ftbjeiextras/modspecific/GlodiumHelpers.java @@ -4,6 +4,9 @@ import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.crafting.Ingredient; +import java.util.Arrays; +import java.util.stream.Stream; + public class GlodiumHelpers { public static Ingredient of(IngredientStack.Item stack) { if (stack.isEmpty()) { @@ -11,11 +14,8 @@ public static Ingredient of(IngredientStack.Item stack) { } Ingredient ingredient = stack.getIngredient(); - ItemStack[] items = ingredient.getItems(); - for (ItemStack item : items) { - item.setCount(stack.getAmount()); - } + Stream stacks = Arrays.stream(ingredient.getItems()).map(oldStack -> oldStack.copyWithCount(stack.getAmount())); - return Ingredient.of(items); + return Ingredient.of(stacks); } }