|
78 | 78 | import mezz.jei.api.gui.drawable.IDrawable;
|
79 | 79 | import mezz.jei.api.helpers.IPlatformFluidHelper;
|
80 | 80 | import mezz.jei.api.recipe.category.IRecipeCategory;
|
| 81 | +import mezz.jei.api.registration.IExtraIngredientRegistration; |
81 | 82 | import mezz.jei.api.registration.IGuiHandlerRegistration;
|
82 | 83 | import mezz.jei.api.registration.IRecipeCatalystRegistration;
|
83 | 84 | import mezz.jei.api.registration.IRecipeCategoryRegistration;
|
|
90 | 91 | import net.minecraft.resources.ResourceLocation;
|
91 | 92 | import net.minecraft.world.item.ItemStack;
|
92 | 93 | import net.minecraft.world.item.Items;
|
| 94 | +import net.minecraft.world.item.alchemy.Potion; |
93 | 95 | import net.minecraft.world.item.crafting.AbstractCookingRecipe;
|
94 | 96 | import net.minecraft.world.item.crafting.CraftingRecipe;
|
95 | 97 | import net.minecraft.world.item.crafting.Recipe;
|
|
98 | 100 | import net.minecraft.world.level.ItemLike;
|
99 | 101 | import net.minecraft.world.level.block.Blocks;
|
100 | 102 | import net.minecraftforge.common.crafting.IShapedRecipe;
|
| 103 | +import net.minecraftforge.fluids.FluidStack; |
101 | 104 | import net.minecraftforge.fml.ModList;
|
| 105 | +import net.minecraftforge.registries.ForgeRegistries; |
102 | 106 |
|
103 | 107 | @JeiPlugin
|
104 | 108 | @SuppressWarnings("unused")
|
@@ -363,6 +367,22 @@ public <T> void registerFluidSubtypes(ISubtypeRegistration registration, IPlatfo
|
363 | 367 | registration.registerSubtypeInterpreter(ForgeTypes.FLUID_STACK, potionFluid.getFlowing(), interpreter);
|
364 | 368 | }
|
365 | 369 |
|
| 370 | + @Override |
| 371 | + public void registerExtraIngredients(IExtraIngredientRegistration registration) { |
| 372 | + Collection<Potion> potions = ForgeRegistries.POTIONS.getValues(); |
| 373 | + Collection<FluidStack> potionFluids = new ArrayList<>(potions.size() * 3); |
| 374 | + for (Potion potion : potions) { |
| 375 | + // @goshante: Ingame potion fluids always have Bottle tag that specifies |
| 376 | + // to what bottle type this potion belongs |
| 377 | + // Potion fluid without this tag wouldn't be recognized by other mods |
| 378 | + for (PotionFluid.BottleType bottleType : PotionFluid.BottleType.values()) { |
| 379 | + FluidStack potionFluid = PotionFluid.of(1000, potion, bottleType); |
| 380 | + potionFluids.add(potionFluid); |
| 381 | + } |
| 382 | + } |
| 383 | + registration.addExtraIngredients(ForgeTypes.FLUID_STACK, potionFluids); |
| 384 | + } |
| 385 | + |
366 | 386 | @SuppressWarnings({ "unchecked", "rawtypes" })
|
367 | 387 | @Override
|
368 | 388 | public void registerGuiHandlers(IGuiHandlerRegistration registration) {
|
|
0 commit comments