11package clashsoft .brewingapi .potion .recipe ;
22
3+ import gnu .trove .map .hash .TCustomHashMap ;
4+
35import java .util .ArrayList ;
46import java .util .List ;
57import java .util .Map ;
68
7- import gnu .trove .map .hash .TCustomHashMap ;
89import clashsoft .brewingapi .potion .type .IPotionType ;
910import clashsoft .brewingapi .potion .type .PotionBase ;
11+ import clashsoft .brewingapi .potion .type .PotionType ;
1012import clashsoft .cslib .minecraft .util .ItemStackHashingStrategy ;
1113
1214import net .minecraft .item .ItemStack ;
15+ import net .minecraft .potion .PotionEffect ;
1316
1417public class PotionRecipes
1518{
@@ -86,7 +89,7 @@ public static void registerRecipe(PotionRecipe recipe)
8689 /**
8790 * Creates and registers a new {@link PotionRecipe} from the given
8891 * {@link ItemStack} {@code input} and the given {@link IPotionType}
89- * {@code output }.
92+ * {@code potionType }.
9093 *
9194 * @param input
9295 * the input stack
@@ -101,7 +104,7 @@ public static void addRecipe(ItemStack ingredient, IPotionType potionType)
101104 /**
102105 * Creates and registers a new {@link PotionRecipe} from the given
103106 * {@link ItemStack} {@code input}, the given {@link PotionBase}
104- * {@code base} and the given {@link IPotionType} {@code output }.
107+ * {@code base} and the given {@link IPotionType} {@code potionType }.
105108 *
106109 * @param input
107110 * the input stack
@@ -115,4 +118,39 @@ public static void addRecipe(ItemStack ingredient, PotionBase base, IPotionType
115118 if (ingredient != null )
116119 registerRecipe (new PotionRecipe (ingredient , base , potionType ));
117120 }
121+
122+ /**
123+ * Creates and registers a new {@link PotionRecipe} from the given
124+ * {@link ItemStack} {@code input} and the given {@link PotionEffect}
125+ * {@code effect}.This automatically finds a {@link PotionType} for the
126+ * effect.
127+ *
128+ * @param input
129+ * the input stack
130+ * @param effect
131+ * the output effect
132+ */
133+ public static void addRecipe (ItemStack ingredient , PotionEffect effect )
134+ {
135+ addRecipe (ingredient , null , effect );
136+ }
137+
138+ /**
139+ * Creates and registers a new {@link PotionRecipe} from the given
140+ * {@link ItemStack} {@code input}, the given {@link PotionBase}
141+ * {@code base} and the given {@link PotionEffect} {@code effect}. This
142+ * automatically finds a {@link PotionType} for the effect.
143+ *
144+ * @param input
145+ * the input stack
146+ * @param base
147+ * the required potion base
148+ * @param effect
149+ * the output effect
150+ */
151+ public static void addRecipe (ItemStack ingredient , PotionBase base , PotionEffect effect )
152+ {
153+ if (ingredient != null )
154+ registerRecipe (new PotionRecipe (ingredient , base , PotionType .getFromEffect (effect )));
155+ }
118156}
0 commit comments