mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-12 08:17:35 +00:00
Make Ingredient explode wildcard values like OreIngredient.
Fixes some issues related to Grums order fix for Shapeless recipes. Other more advanced usages need to be documented and tested.
This commit is contained in:
1 parent
7d21b324ec
commit
fc87d83d73
5 files changed
+101
-10
No files matched your search
@@ -143,14 +143,15 @@ public class CraftingHelper {
|
||||
if (json.isJsonArray())
|
||||
{
|
||||
List<Ingredient> ingredients = Lists.newArrayList();
|
||||
List<ItemStack> vanilla = Lists.newArrayList();
|
||||
json.getAsJsonArray().forEach((ele) -> {
|
||||
List<Ingredient> vanilla = Lists.newArrayList();
|
||||
json.getAsJsonArray().forEach((ele) ->
|
||||
{
|
||||
Ingredient ing = CraftingHelper.getIngredient(ele, context);
|
||||
|
||||
if (ing.getClass() == Ingredient.class) {
|
||||
if (ing.getClass() == Ingredient.class)
|
||||
{
|
||||
//Vanilla, Due to how we read it splits each itemstack, so we pull out to re-merge later
|
||||
for (ItemStack stack : ing.getMatchingStacks())
|
||||
vanilla.add(stack);
|
||||
vanilla.add(ing);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -160,8 +161,7 @@ public class CraftingHelper {
|
||||
|
||||
if (!vanilla.isEmpty())
|
||||
{
|
||||
ItemStack[] items = vanilla.toArray(new ItemStack[vanilla.size()]);
|
||||
ingredients.add(Ingredient.fromStacks(items));
|
||||
ingredients.add(Ingredient.merge(vanilla));
|
||||
}
|
||||
|
||||
if (ingredients.size() == 0)
|
||||
|
||||
Reference in new issue
Block a user