package mezz.jei.plugins.vanilla.crafting.replacers;

import mezz.jei.api.constants.ModIds;
import net.minecraft.core.NonNullList;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.Items;
import net.minecraft.world.item.alchemy.PotionUtils;
import net.minecraft.world.item.crafting.CraftingRecipe;
import net.minecraft.world.item.crafting.Ingredient;
import net.minecraft.world.item.crafting.ShapedRecipe;
import net.minecraftforge.common.crafting.NBTIngredient;
import net.minecraftforge.registries.ForgeRegistries;

import java.util.stream.Stream;

public final class TippedArrowRecipeMaker {

	public static Stream<CraftingRecipe> createRecipes() {
		String group = "jei.tipped.arrow";
		return ForgeRegistries.POTIONS.getValues().stream()
			.map(potion -> {
				ItemStack arrowStack = new ItemStack(Items.ARROW);
				ItemStack lingeringPotion = PotionUtils.setPotion(new ItemStack(Items.LINGERING_POTION), potion);
				Ingredient arrowIngredient = Ingredient.of(arrowStack);
				Ingredient potionIngredient = new NBTIngredient(lingeringPotion) {
				};
				NonNullList<Ingredient> inputs = NonNullList.of(Ingredient.EMPTY,
					arrowIngredient, arrowIngredient, arrowIngredient,
					arrowIngredient, potionIngredient, arrowIngredient,
					arrowIngredient, arrowIngredient, arrowIngredient
				);
				ItemStack output = new ItemStack(Items.TIPPED_ARROW, 8);
				PotionUtils.setPotion(output, potion);
				ResourceLocation id = new ResourceLocation(ModIds.MINECRAFT_ID, "jei.tipped.arrow." + output.getDescriptionId());
				return new ShapedRecipe(id, group, 3, 3, inputs, output);
			});
	}

	private TippedArrowRecipeMaker() {

	}
}

@@ -756,16 +756,128 @@
 arrow%22;%0A
+%09%09ItemStack arrowStack = new ItemStack(Items.ARROW);%0A%09%09Ingredient arrowIngredient = Ingredient.of(arrowStack);%0A%0A
 %09%09return
@@ -960,46 +960,83 @@
 ack 
-arrowStack = new ItemStack(Items.ARROW
+input = PotionUtils.setPotion(new ItemStack(Items.LINGERING_POTION), potion
 );%0A%09
@@ -1048,31 +1048,22 @@
 emStack 
-lingeringPotion
+output
  = Potio
@@ -1103,95 +1103,35 @@
 ems.
-LINGERING_POTION), potion);%0A%09%09%09%09Ingredient arrowIngredient = Ingredient.of(arrowStack);
+TIPPED_ARROW, 8), potion);%0A
 %0A%09%09%09
@@ -1183,31 +1183,16 @@
 ent(
-l
 in
-geringPotion) %7B%0A%09%09%09%09
+put) %7B
 %7D;%0A%09
@@ -1439,112 +1439,8 @@
 %09);%0A
-%09%09%09%09ItemStack output = new ItemStack(Items.TIPPED_ARROW, 8);%0A%09%09%09%09PotionUtils.setPotion(output, potion);%0A
 %09%09%09%09

Clean up TippedArrowRecipeMaker