File tree Expand file tree Collapse file tree
src/main/java/com/blakebr0/extendedcrafting/compat/crafttweaker Expand file tree Collapse file tree Original file line number Diff line number Diff line change 22
33import crafttweaker .api .data .IData ;
44import crafttweaker .api .item .IIngredient ;
5- import crafttweaker .api .item .IItemStack ;
65import crafttweaker .api .minecraft .CraftTweakerMC ;
7- import net .minecraft .item .ItemStack ;
86import net .minecraft .item .crafting .Ingredient ;
97import net .minecraft .nbt .NBTBase ;
108import net .minecraft .util .NonNullList ;
@@ -36,26 +34,7 @@ public static NonNullList<Ingredient> toIngredients(IIngredient... ingredients)
3634
3735 @ Nonnull
3836 public static Ingredient toIngredient (@ Nullable IIngredient ingredient ) {
39- return ingredient == null ? Ingredient . EMPTY : new CTIngredientWrapper (ingredient );
37+ return CraftTweakerMC . getIngredient (ingredient );
4038 }
4139
42- private static class CTIngredientWrapper extends Ingredient {
43-
44- private final IIngredient ingredient ;
45-
46- private CTIngredientWrapper (IIngredient ingredient ) {
47- super (CraftTweakerMC .getItemStacks (ingredient .getItemArray ()));
48- this .ingredient = ingredient ;
49- }
50-
51- @ Override
52- public boolean apply (@ Nullable ItemStack stack ) {
53- if (stack == null ) {
54- return ingredient .matches ((IItemStack ) null );
55- }
56- stack = stack .copy ();
57- stack .setCount (ingredient .getAmount ());
58- return ingredient .matches (CraftTweakerMC .getIItemStack (stack ));
59- }
60- }
6140}
You can’t perform that action at this time.
0 commit comments