public class CraftingRecipeCategory extends java.lang.Object implements IExtendableRecipeCategory<net.minecraft.item.crafting.ICraftingRecipe,ICraftingCategoryExtension>
| Constructor and Description |
|---|
CraftingRecipeCategory(IGuiHelper guiHelper) |
| Modifier and Type | Method and Description |
|---|---|
<R extends net.minecraft.item.crafting.ICraftingRecipe> |
addCategoryExtension(java.lang.Class<? extends R> recipeClass,
java.util.function.Function<R,? extends ICraftingCategoryExtension> extensionFactory) |
<R extends net.minecraft.item.crafting.ICraftingRecipe> |
addCategoryExtension(java.lang.Class<? extends R> recipeClass,
java.util.function.Predicate<R> extensionFilter,
java.util.function.Function<R,? extends ICraftingCategoryExtension> extensionFactory) |
void |
draw(net.minecraft.item.crafting.ICraftingRecipe 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 net.minecraft.item.crafting.ICraftingRecipe> |
getRecipeClass() |
java.lang.String |
getTitle()
Deprecated.
|
net.minecraft.util.text.ITextComponent |
getTitleAsTextComponent()
Returns a text component representing the name of this recipe type.
|
java.util.List<net.minecraft.util.text.ITextComponent> |
getTooltipStrings(net.minecraft.item.crafting.ICraftingRecipe 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.
|
boolean |
handleClick(net.minecraft.item.crafting.ICraftingRecipe recipe,
double mouseX,
double mouseY,
int mouseButton)
Called when a player clicks the recipe.
|
boolean |
isHandled(net.minecraft.item.crafting.ICraftingRecipe recipe) |
void |
setIngredients(net.minecraft.item.crafting.ICraftingRecipe recipe,
IIngredients ingredients)
Sets all the recipe's ingredients by filling out an instance of
IIngredients. |
void |
setRecipe(IRecipeLayout recipeLayout,
net.minecraft.item.crafting.ICraftingRecipe recipe,
IIngredients ingredients)
Set the
IRecipeLayout properties from the recipe. |
public static final int width
public static final int height
public CraftingRecipeCategory(IGuiHelper guiHelper)
public net.minecraft.util.ResourceLocation getUid()
IRecipeCategorygetUid in interface IRecipeCategory<net.minecraft.item.crafting.ICraftingRecipe>for vanilla examplespublic java.lang.Class<? extends net.minecraft.item.crafting.ICraftingRecipe> getRecipeClass()
getRecipeClass in interface IRecipeCategory<net.minecraft.item.crafting.ICraftingRecipe>@Deprecated public java.lang.String getTitle()
IRecipeCategorygetTitle in interface IRecipeCategory<net.minecraft.item.crafting.ICraftingRecipe>public net.minecraft.util.text.ITextComponent getTitleAsTextComponent()
IRecipeCategorygetTitleAsTextComponent in interface IRecipeCategory<net.minecraft.item.crafting.ICraftingRecipe>public IDrawable getBackground()
IRecipeCategorygetBackground in interface IRecipeCategory<net.minecraft.item.crafting.ICraftingRecipe>public IDrawable getIcon()
IRecipeCategoryIGuiHelper.createDrawableIngredient(Object) to create a drawable from an ingredient.getIcon in interface IRecipeCategory<net.minecraft.item.crafting.ICraftingRecipe>public void setRecipe(IRecipeLayout recipeLayout, net.minecraft.item.crafting.ICraftingRecipe recipe, IIngredients ingredients)
IRecipeCategoryIRecipeLayout properties from the recipe.setRecipe in interface IRecipeCategory<net.minecraft.item.crafting.ICraftingRecipe>recipeLayout - the layout that needs its properties set.recipe - the recipe, for extra information.ingredients - the ingredients, already set earlier by IRecipeCategory.setIngredients(T, mezz.jei.api.ingredients.IIngredients)public void setIngredients(net.minecraft.item.crafting.ICraftingRecipe recipe,
IIngredients ingredients)
IRecipeCategoryIIngredients.
This is used by JEI for lookups, to figure out what ingredients are inputs and outputs for a recipe.setIngredients in interface IRecipeCategory<net.minecraft.item.crafting.ICraftingRecipe>public void draw(net.minecraft.item.crafting.ICraftingRecipe recipe,
com.mojang.blaze3d.matrix.MatrixStack matrixStack,
double mouseX,
double mouseY)
IRecipeCategoryIRecipeCategory.getTooltipStrings(Object, double, double)draw in interface IRecipeCategory<net.minecraft.item.crafting.ICraftingRecipe>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.public java.util.List<net.minecraft.util.text.ITextComponent> getTooltipStrings(net.minecraft.item.crafting.ICraftingRecipe recipe,
double mouseX,
double mouseY)
IRecipeCategoryIGuiIngredientGroup.addTooltipCallback(ITooltipCallback)getTooltipStrings in interface IRecipeCategory<net.minecraft.item.crafting.ICraftingRecipe>mouseX - the X position of the mouse, relative to the recipe.mouseY - the Y position of the mouse, relative to the recipe.public boolean handleClick(net.minecraft.item.crafting.ICraftingRecipe recipe,
double mouseX,
double mouseY,
int mouseButton)
IRecipeCategoryhandleClick in interface IRecipeCategory<net.minecraft.item.crafting.ICraftingRecipe>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.public boolean isHandled(net.minecraft.item.crafting.ICraftingRecipe recipe)
isHandled in interface IRecipeCategory<net.minecraft.item.crafting.ICraftingRecipe>public <R extends net.minecraft.item.crafting.ICraftingRecipe> void addCategoryExtension(java.lang.Class<? extends R> recipeClass,
java.util.function.Function<R,? extends ICraftingCategoryExtension> extensionFactory)
addCategoryExtension in interface IExtendableRecipeCategory<net.minecraft.item.crafting.ICraftingRecipe,ICraftingCategoryExtension>recipeClass - the class of recipes to handleextensionFactory - a factory that can turn recipes into recipe extensionspublic <R extends net.minecraft.item.crafting.ICraftingRecipe> void addCategoryExtension(java.lang.Class<? extends R> recipeClass,
java.util.function.Predicate<R> extensionFilter,
java.util.function.Function<R,? extends ICraftingCategoryExtension> extensionFactory)
addCategoryExtension in interface IExtendableRecipeCategory<net.minecraft.item.crafting.ICraftingRecipe,ICraftingCategoryExtension>recipeClass - the class of recipes to handleextensionFilter - a filter that returns true for instances of the recipe that can be handled by the extensionFactoryextensionFactory - a factory that can turn recipes into recipe extensions