You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add some overloads to help create basic multi input ingredients. Also update docs to state that the default components are not included on the ingredient when created by item or stack, and that the ingredient needs to be manually created
* Creates a Chemical Stack Ingredient that matches any of the provided chemicals.
57
+
*
58
+
* @param amount Amount needed.
59
+
* @param chemicals Chemicals to match.
60
+
*
61
+
* @throws NullPointerException if the given instance is null.
62
+
* @throws IllegalArgumentException if the given instance is empty or an amount smaller than one; or if no types or only a single type is passed. Call via
63
+
* {@link #from(IChemicalProvider, long)} if you only have one element.
thrownewIllegalArgumentException("Attempted to create an ChemicalStackIngredients with less than two chemicals. At least one chemical is required, and if you only have one use from(IChemicalProvider, long) instead.");
@@ -23,29 +24,69 @@ public interface IFluidStackIngredientCreator extends IIngredientCreator<Fluid,
23
24
*
24
25
* @throws NullPointerException if the given instance is null.
25
26
* @throws IllegalArgumentException if the given instance is empty or an amount smaller than one.
27
+
* @implNote This wraps via {@link #from(FluidIngredient, int)} so if there is any durability or default NBT it will <strong>NOT</strong> be included in the
28
+
* ingredient. If this is not desired, manually create the ingredient via {@link DataComponentFluidIngredient} and call {@link #from(FluidIngredient, int)}.
Objects.requireNonNull(provider, "FluidStackIngredients cannot be created from a null fluid provider.");
29
32
returnfrom(provider.getFluidStack(amount));
30
33
}
31
34
35
+
/**
36
+
* Creates an Item Stack Ingredient that matches a provided items and amount.
37
+
*
38
+
* @param amount Amount needed.
39
+
* @param fluids Fluid providers that provides the items to match.
40
+
*
41
+
* @implNote This wraps via {@link #from(FluidIngredient, int)} so if there is any durability or default NBT it will <strong>NOT</strong> be included in the
42
+
* ingredient. If this is not desired, manually create the ingredient via {@link DataComponentFluidIngredient} and call {@link #from(FluidIngredient, int)}.
* @implNote This wraps via {@link #from(FluidIngredient, int)} so if there is any durability or default NBT it will <strong>NOT</strong> be included in the
53
+
* ingredient. If this is not desired, manually create the ingredient via {@link DataComponentFluidIngredient} and call {@link #from(FluidIngredient, int)}.
* @implNote This wraps via {@link #from(FluidIngredient, int)} so if there is any durability or default NBT it will <strong>NOT</strong> be included in the
64
+
* ingredient. If this is not desired, manually create the ingredient via {@link DataComponentFluidIngredient} and call {@link #from(FluidIngredient, int)}.
thrownewIllegalArgumentException("Attempted to create an FluidStackIngredient with less than two fluids. At least one fluid is required, and if you only have one use from(Fluid, int) instead.");
71
+
}
72
+
returnfrom(FluidIngredient.of(fluids), amount);
73
+
}
74
+
75
+
/**
76
+
* {@inheritDoc}
77
+
*
78
+
* @implNote If the stack has any non-default data components, a non-strict component matching those additions will be used.
* Creates an Ingredient that matches any of the provided types.
38
+
*
39
+
* @param amount Amount needed.
40
+
* @param items Types to match.
41
+
*
42
+
* @throws NullPointerException if the given instance is null.
43
+
* @throws IllegalArgumentException if the given instance is empty or an amount smaller than one; or if no types or only a single type is passed. Call via
44
+
* {@link #from(Object, int)} if you only have one element.
45
+
* @since 10.6.0
46
+
*/
47
+
INGREDIENTfrom(intamount, TYPE... items);
48
+
36
49
/**
37
50
* Creates an Ingredient that matches a provided type and amount.
* @param item Item provider that provides the item to match.
66
72
*
67
-
* @implNote This wraps via {@link #from(ItemStack)} so if there is any durability or default NBT it will be included in the ingredient. If this is not desired,
68
-
* manually create an ingredient and call {@link #from(Ingredient)}.
73
+
* @implNote This wraps via {@link #from(Ingredient)} so if there is any durability or default NBT it will <strong>NOT</strong> be included in the ingredient. If this
74
+
* is not desired, manually create the ingredient via {@link DataComponentIngredient} and call {@link #from(Ingredient)}.
* @param item Item provider that provides the item to match.
78
84
* @param amount Amount needed.
79
85
*
80
-
* @implNote This wraps via {@link #from(ItemStack, int)} so if there is any durability or default NBT it will be included in the ingredient. If this is not desired,
81
-
* manually create an ingredient and call {@link #from(Ingredient, int)}.
86
+
* @implNote This wraps via {@link #from(Ingredient, int)} so if there is any durability or default NBT it will <strong>NOT</strong> be included in the ingredient. If
87
+
* this is not desired, manually create the ingredient via {@link DataComponentIngredient} and call {@link #from(Ingredient, int)}.
* Creates an Item Stack Ingredient that matches a provided items.
95
+
*
96
+
* @param items Item providers that provides the items to match.
97
+
*
98
+
* @throws IllegalArgumentException if no items are passed, or only a single item is passed. Call via {@link #from(ItemLike)} if you only have one element.
99
+
* @implNote This wraps via {@link #from(Ingredient)} so if there is any durability or default NBT it will <strong>NOT</strong> be included in the ingredient. If this
100
+
* is not desired, manually create the ingredients via {@link DataComponentIngredient} and call {@link #from(Ingredient)}.
* Creates an Item Stack Ingredient that matches a provided items and amount.
109
+
*
110
+
* @param amount Amount needed.
111
+
* @param items Item providers that provides the items to match.
112
+
*
113
+
* @throws IllegalArgumentException if no items are passed, or only a single item is passed. Call via {@link #from(ItemLike, int)} if you only have one element.
114
+
* @implNote This wraps via {@link #from(Ingredient, int)} so if there is any durability or default NBT it will <strong>NOT</strong> be included in the ingredient. If
115
+
* this is not desired, manually create the ingredients via {@link DataComponentIngredient} and call {@link #from(Ingredient, int)}.
thrownewIllegalArgumentException("Attempted to create an ItemStackIngredient with less than two items. At least one item is required, and if you only have one use from(ItemLike, int) instead.");
121
+
}
122
+
returnfrom(Ingredient.of(items), amount);
85
123
}
86
124
87
125
/**
88
126
* {@inheritDoc}
89
127
*
90
-
* @implNote This wraps via {@link #from(ItemStack)} so if there is any durability or default NBT it will be included in the ingredient. If this is not desired,
91
-
* manually create an ingredient and call {@link #from(Ingredient)}.
128
+
* @implNote This wraps via {@link #from(Ingredient)} so if there is any durability or default NBT it will <strong>NOT</strong> be included in the ingredient. If this
129
+
* is not desired, manually create the ingredient via {@link DataComponentIngredient} and call {@link #from(Ingredient)}.
* @implNote This wraps via {@link #from(Ingredient)} so if there is any durability or default NBT it will <strong>NOT</strong> be included in the ingredient. If this
140
+
* is not desired, manually create the ingredient via {@link DataComponentIngredient} and call {@link #from(Ingredient)}.
0 commit comments