@@ -48,6 +48,15 @@ public static void addFilterRecipe(String name, IIngredient input, IItemStack[]
4848 Lists .newArrayList (CraftTweakerMC .getItemStacks (outputs )),
4949 Lists .newArrayList (CraftTweakerMC .getItemStacks (secondary ))));
5050 }
51+
52+ @ ZenMethod
53+ public static void addSoulUseRecipe (String name , IIngredient input , int soulAmount , IItemStack [] outputs , IItemStack [] secondary ) {
54+ ModTweaker .LATE_ADDITIONS .add (new AddSoulUseRecipe (name ,
55+ CraftTweakerMC .getIngredient (input ),
56+ soulAmount ,
57+ Lists .newArrayList (CraftTweakerMC .getItemStacks (outputs )),
58+ Lists .newArrayList (CraftTweakerMC .getItemStacks (secondary ))));
59+ }
5160
5261 @ ZenMethod
5362 public static void addSoulUrnRecipe (IIngredient input , IItemStack [] outputs , IItemStack [] secondary ) {
@@ -184,6 +193,38 @@ public void apply() {
184193 HopperInteractions .addHopperRecipe (new HopperInteractions .HopperRecipe (filterName ,input ,outputs ,secondary ));
185194 }
186195 }
196+
197+ public static class AddSoulUseRecipe extends BaseAction {
198+ String filterName ;
199+ Ingredient input ;
200+ int soulAmount ;
201+ List <ItemStack > outputs ;
202+ List <ItemStack > secondary ;
203+
204+ public AddSoulUseRecipe (String filterName , Ingredient input , int soulAmount , List <ItemStack > outputs , List <ItemStack > secondary ) {
205+ super ("Filtered Hopper" );
206+ this .filterName = filterName ;
207+ this .input = input ;
208+ this .soulAmount = soulAmount ;
209+ this .outputs = outputs ;
210+ this .secondary = secondary ;
211+ }
212+
213+ @ Override
214+ protected String getRecipeInfo () {
215+ return String .format ("%s -> %s,%s in %s with %s souls" ,
216+ Arrays .toString (input .getMatchingStacks ()),
217+ outputs .stream ().map (ItemStack ::getDisplayName ).collect (Collectors .joining ("," )),
218+ secondary .stream ().map (ItemStack ::getDisplayName ).collect (Collectors .joining ("," )),
219+ filterName ,
220+ String .valueOf (soulAmount ));
221+ }
222+
223+ @ Override
224+ public void apply () {
225+ HopperInteractions .addHopperRecipe (new HopperInteractions .SoulUseRecipe (filterName ,input ,soulAmount ,outputs ,secondary ));
226+ }
227+ }
187228
188229 public static class AddSoulUrnRecipe extends BaseAction {
189230 Ingredient input ;
0 commit comments