|
19 | 19 | import mekanism.api.recipes.chemical.ItemStackToChemicalRecipe; |
20 | 20 | import mekanism.api.recipes.ingredients.ChemicalStackIngredient; |
21 | 21 | import mekanism.api.recipes.ingredients.SlurryStackIngredient; |
22 | | -import mekanism.api.recipes.ingredients.creator.IngredientCreatorAccess; |
23 | 22 | import mekanism.client.gui.element.bar.GuiBar.IBarInfoHandler; |
24 | 23 | import mekanism.client.gui.element.progress.IProgressInfoHandler; |
25 | 24 | import mekanism.common.Mekanism; |
26 | 25 | import mekanism.common.MekanismLang; |
27 | 26 | import mekanism.common.recipe.IMekanismRecipeTypeProvider; |
28 | 27 | import mekanism.common.recipe.MekanismRecipeType; |
29 | | -import mekanism.common.recipe.impl.NutritionalLiquifierIRecipe; |
30 | | -import mekanism.common.registries.MekanismFluids; |
31 | 28 | import mekanism.common.tier.ChemicalTankTier; |
| 29 | +import mekanism.common.tile.machine.TileEntityNutritionalLiquifier; |
32 | 30 | import mekanism.common.util.ChemicalUtil; |
33 | 31 | import mekanism.common.util.RegistryUtils; |
34 | 32 | import net.minecraft.SharedConstants; |
35 | 33 | import net.minecraft.core.HolderSet.Named; |
36 | | -import net.minecraft.core.component.DataComponents; |
37 | 34 | import net.minecraft.core.registries.BuiltInRegistries; |
38 | 35 | import net.minecraft.network.chat.Component; |
39 | 36 | import net.minecraft.resources.ResourceLocation; |
40 | 37 | import net.minecraft.tags.TagKey; |
41 | 38 | import net.minecraft.util.TimeUtil; |
42 | | -import net.minecraft.world.food.FoodProperties; |
43 | 39 | import net.minecraft.world.item.Item; |
44 | 40 | import net.minecraft.world.item.ItemStack; |
45 | 41 | import net.minecraft.world.item.crafting.RecipeHolder; |
@@ -139,18 +135,9 @@ public static Map<ResourceLocation, ItemStackToFluidOptionalItemRecipe> getLiqui |
139 | 135 | // CreativeModeTabs.searchTab().getDisplayItems(). The bigger issue is how to come up with unique synthetic |
140 | 136 | // names for the recipes as EMI requires they be unique. (Maybe index them?) |
141 | 137 | for (Item item : BuiltInRegistries.ITEM) { |
142 | | - ItemStack stack = new ItemStack(item); |
143 | | - if (stack.has(DataComponents.FOOD)) { |
144 | | - FoodProperties food = stack.getFoodProperties(null); |
145 | | - //Only display consuming foods that provide healing as otherwise no paste will be made |
146 | | - if (food != null && food.nutrition() > 0) { |
147 | | - ResourceLocation id = RecipeViewerUtils.synthetic(RegistryUtils.getName(stack.getItem()), "liquification", Mekanism.MODID); |
148 | | - liquification.put(id, new NutritionalLiquifierIRecipe( |
149 | | - IngredientCreatorAccess.item().from(stack), |
150 | | - MekanismFluids.NUTRITIONAL_PASTE.getFluidStack(food.nutrition() * 50), |
151 | | - food.usingConvertsTo().orElse(ItemStack.EMPTY) |
152 | | - )); |
153 | | - } |
| 138 | + ItemStackToFluidOptionalItemRecipe recipe = TileEntityNutritionalLiquifier.getRecipe(item.getDefaultInstance()); |
| 139 | + if (recipe != null) { |
| 140 | + liquification.put(RecipeViewerUtils.synthetic(RegistryUtils.getName(item), "liquification", Mekanism.MODID), recipe); |
154 | 141 | } |
155 | 142 | } |
156 | 143 | return liquification; |
|
0 commit comments