-
Notifications
You must be signed in to change notification settings - Fork 305
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create a way to add extra ingredients in the API (not at runtime)
- Loading branch information
Showing
8 changed files
with
98 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
52 changes: 52 additions & 0 deletions
52
CommonApi/src/main/java/mezz/jei/api/registration/IExtraIngredientRegistration.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
package mezz.jei.api.registration; | ||
|
||
import mezz.jei.api.IModPlugin; | ||
import mezz.jei.api.constants.VanillaTypes; | ||
import mezz.jei.api.helpers.IColorHelper; | ||
import mezz.jei.api.helpers.IPlatformFluidHelper; | ||
import mezz.jei.api.ingredients.IIngredientHelper; | ||
import mezz.jei.api.ingredients.IIngredientRenderer; | ||
import mezz.jei.api.ingredients.IIngredientType; | ||
import mezz.jei.api.ingredients.subtypes.ISubtypeManager; | ||
import mezz.jei.api.runtime.IIngredientManager; | ||
import net.minecraft.world.item.ItemStack; | ||
|
||
import java.util.Collection; | ||
|
||
/** | ||
* Allows adding extra ingredients (including ItemStack and FluidStack) for any registered ingredient type. | ||
* | ||
* This is intended to be used to add ingredients to another mod's type. | ||
* If you want to add ingredients to your own custom type, | ||
* pass them to {@link IModIngredientRegistration#register} instead. | ||
* | ||
* This is given to your {@link IModPlugin#registerExtraIngredients(IExtraIngredientRegistration)}. | ||
* | ||
* @since 19.18.0 | ||
*/ | ||
public interface IExtraIngredientRegistration { | ||
/** | ||
* Add extra ItemStacks that are not already in the creative menu. | ||
* | ||
* @param extraItemStacks A collection of extra ItemStacks to be displayed in the ingredient list. | ||
* | ||
* @since 19.18.0 | ||
*/ | ||
default void addExtraItemStacks(Collection<ItemStack> extraItemStacks) { | ||
addExtraIngredients(VanillaTypes.ITEM_STACK, extraItemStacks); | ||
} | ||
|
||
/** | ||
* Add extra ingredients to an existing ingredient type. | ||
* | ||
* @param ingredientType The type of the ingredient. | ||
* This must already be registered with {@link IModIngredientRegistration#register} by another mod. | ||
* @param extraIngredients A collection of extra ingredients to be displayed in the ingredient list. | ||
* | ||
* @since 19.18.0 | ||
*/ | ||
<V> void addExtraIngredients( | ||
IIngredientType<V> ingredientType, | ||
Collection<V> extraIngredients | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -74,4 +74,4 @@ modrinthId=u6dRKJwZ | |
jUnitVersion=5.8.2 | ||
|
||
# Version | ||
specificationVersion=19.17.0 | ||
specificationVersion=19.18.0 |