public interface IRecipeCategory<T>
#setRecipe(IRecipeLayout, T, IIngredients)
.
Also draws elements that are common to all recipes in the category like the background.Modifier and Type | Method and Description |
---|---|
default void |
draw(T recipe,
com.mojang.blaze3d.matrix.MatrixStack matrixStack,
double mouseX,
double mouseY)
Draw extras or additional info about the recipe.
|
IDrawable |
getBackground()
Returns the drawable background for a single recipe in this category.
|
IDrawable |
getIcon()
Icon for the category tab.
|
java.lang.Class<? extends T> |
getRecipeClass() |
java.lang.String |
getTitle()
Deprecated.
Since JEI 7.6.4, prefer calling and using
getTitleAsTextComponent() . |
default net.minecraft.util.text.ITextComponent |
getTitleAsTextComponent()
Returns a text component representing the name of this recipe type.
|
default java.util.List<net.minecraft.util.text.ITextComponent> |
getTooltipStrings(T recipe,
double mouseX,
double mouseY)
Get the tooltip for whatever's under the mouse.
|
net.minecraft.util.ResourceLocation |
getUid()
Returns a unique ID for this recipe category.
|
default boolean |
handleClick(T recipe,
double mouseX,
double mouseY,
int mouseButton)
Called when a player clicks the recipe.
|
default boolean |
isHandled(T recipe) |
void |
setIngredients(T recipe,
IIngredients ingredients)
Sets all the recipe's ingredients by filling out an instance of
IIngredients . |
void |
setRecipe(IRecipeLayout recipeLayout,
T recipe,
IIngredients ingredients)
Set the
IRecipeLayout properties from the recipe. |
net.minecraft.util.ResourceLocation getUid()
for vanilla examples
java.lang.Class<? extends T> getRecipeClass()
@Deprecated java.lang.String getTitle()
getTitleAsTextComponent()
.default net.minecraft.util.text.ITextComponent getTitleAsTextComponent()
IDrawable getBackground()
IDrawable getIcon()
IGuiHelper.createDrawableIngredient(Object)
to create a drawable from an ingredient.void setIngredients(T recipe, IIngredients ingredients)
IIngredients
.
This is used by JEI for lookups, to figure out what ingredients are inputs and outputs for a recipe.void setRecipe(IRecipeLayout recipeLayout, T recipe, IIngredients ingredients)
IRecipeLayout
properties from the recipe.recipeLayout
- the layout that needs its properties set.recipe
- the recipe, for extra information.ingredients
- the ingredients, already set earlier by setIngredients(T, mezz.jei.api.ingredients.IIngredients)
default void draw(T recipe, com.mojang.blaze3d.matrix.MatrixStack matrixStack, double mouseX, double mouseY)
getTooltipStrings(Object, double, double)
mouseX
- the X position of the mouse, relative to the recipe.mouseY
- the Y position of the mouse, relative to the recipe.for a simple class for drawing things.
,
for useful functions.
default java.util.List<net.minecraft.util.text.ITextComponent> getTooltipStrings(T recipe, double mouseX, double mouseY)
IGuiIngredientGroup.addTooltipCallback(ITooltipCallback)
mouseX
- the X position of the mouse, relative to the recipe.mouseY
- the Y position of the mouse, relative to the recipe.default boolean handleClick(T recipe, double mouseX, double mouseY, int mouseButton)
mouseX
- the X position of the mouse, relative to the recipe.mouseY
- the Y position of the mouse, relative to the recipe.mouseButton
- the current mouse event button.default boolean isHandled(T recipe)