Skip to content

Commit 3a3edb6

Browse files
committed
Add convenience function for adding an info recipe for ItemLike
1 parent 6465fc1 commit 3a3edb6

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

CommonApi/src/main/java/mezz/jei/api/registration/IRecipeRegistration.java

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import mezz.jei.api.runtime.IIngredientVisibility;
1010
import net.minecraft.network.chat.Component;
1111
import net.minecraft.world.item.ItemStack;
12+
import net.minecraft.world.level.ItemLike;
1213

1314
import java.util.List;
1415

@@ -71,6 +72,21 @@ public interface IRecipeRegistration {
7172
*/
7273
<T> void addIngredientInfo(List<T> ingredients, IIngredientType<T> ingredientType, Component... descriptionComponents);
7374

75+
/**
76+
* Add an info page for an ItemLike.
77+
* Description pages show in the recipes for an ItemStack and tell the player a little about it.
78+
*
79+
* @param itemLike The ItemLike to describe
80+
* @param descriptionComponents Text components for info text.
81+
* New lines can be added with "\n" or by giving multiple descriptions.
82+
* Long lines are wrapped automatically.
83+
* Very long entries will span multiple pages automatically.
84+
* @since 19.18.3
85+
*/
86+
default void addIngredientInfo(ItemLike itemLike, Component... descriptionComponents) {
87+
addIngredientInfo(new ItemStack(itemLike), VanillaTypes.ITEM_STACK, descriptionComponents);
88+
}
89+
7490
/**
7591
* Add an info page for an ItemStack.
7692
* Description pages show in the recipes for an ItemStack and tell the player a little about it.

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,4 +74,4 @@ modrinthId=u6dRKJwZ
7474
jUnitVersion=5.8.2
7575

7676
# Version
77-
specificationVersion=19.18.2
77+
specificationVersion=19.18.3

0 commit comments

Comments
 (0)