public class RecipeLayout<T> extends java.lang.Object implements IRecipeLayoutDrawable
| Modifier and Type | Method and Description |
|---|---|
static <T> RecipeLayout<T> |
create(int index,
IRecipeCategory<T> recipeCategory,
T recipe,
Focus<?> focus,
IModIdHelper modIdHelper,
int posX,
int posY) |
void |
drawOverlays(com.mojang.blaze3d.matrix.MatrixStack matrixStack,
int mouseX,
int mouseY)
Draw the recipe overlays such as item tool tips.
|
void |
drawRecipe(com.mojang.blaze3d.matrix.MatrixStack matrixStack,
int mouseX,
int mouseY)
Draw the recipe without overlays such as item tool tips.
|
IGuiFluidStackGroup |
getFluidStacks()
Contains all the fluidStacks displayed on this recipe layout.
|
Focus<?> |
getFocus()
The current search focus.
|
<V> Focus<V> |
getFocus(IIngredientType<V> ingredientType)
The current search focus.
|
GuiIngredient<?> |
getGuiIngredientUnderMouse(double mouseX,
double mouseY) |
<V> IGuiIngredientGroup<V> |
getIngredientsGroup(IIngredientType<V> ingredientType)
Get all the ingredients of one type that are displayed on this recipe layout.
|
java.lang.Object |
getIngredientUnderMouse(int mouseX,
int mouseY)
Returns the ingredient currently under the mouse, if there is one.
|
GuiItemStackGroup |
getItemStacks()
Contains all the itemStacks displayed on this recipe layout.
|
int |
getPosX() |
int |
getPosY() |
T |
getRecipe() |
IRecipeCategory<?> |
getRecipeCategory()
The current recipe category.
|
RecipeTransferButton |
getRecipeTransferButton() |
boolean |
handleClick(double mouseX,
double mouseY,
int mouseButton) |
boolean |
isMouseOver(double mouseX,
double mouseY)
Returns true if the mouse is hovering over the recipe.
|
void |
moveRecipeTransferButton(int posX,
int posY)
Moves the recipe transfer button's position relative to the recipe layout.
|
void |
setPosition(int posX,
int posY)
Set the position of the recipe layout in screen coordinates.
|
void |
setShapeless()
Adds a shapeless icon to the top right of the recipe, that shows a tooltip saying "shapeless" when hovered over.
|
@Nullable public static <T> RecipeLayout<T> create(int index, IRecipeCategory<T> recipeCategory, T recipe, @Nullable Focus<?> focus, IModIdHelper modIdHelper, int posX, int posY)
public void setPosition(int posX,
int posY)
IRecipeLayoutDrawableIRecipeCategory.getBackground().setPosition in interface IRecipeLayoutDrawablepublic void drawRecipe(com.mojang.blaze3d.matrix.MatrixStack matrixStack,
int mouseX,
int mouseY)
IRecipeLayoutDrawabledrawRecipe in interface IRecipeLayoutDrawablepublic void drawOverlays(com.mojang.blaze3d.matrix.MatrixStack matrixStack,
int mouseX,
int mouseY)
IRecipeLayoutDrawabledrawOverlays in interface IRecipeLayoutDrawablepublic boolean isMouseOver(double mouseX,
double mouseY)
IRecipeLayoutDrawableisMouseOver in interface IRecipeLayoutDrawable@Nullable
public java.lang.Object getIngredientUnderMouse(int mouseX,
int mouseY)
IRecipeLayoutDrawablegetIngredientUnderMouse in interface IRecipeLayoutDrawable@Nullable public GuiIngredient<?> getGuiIngredientUnderMouse(double mouseX, double mouseY)
public boolean handleClick(double mouseX,
double mouseY,
int mouseButton)
public GuiItemStackGroup getItemStacks()
IRecipeLayoutgetItemStacks in interface IRecipeLayoutpublic IGuiFluidStackGroup getFluidStacks()
IRecipeLayoutgetFluidStacks in interface IRecipeLayoutpublic <V> IGuiIngredientGroup<V> getIngredientsGroup(IIngredientType<V> ingredientType)
IRecipeLayoutIModIngredientRegistration.getIngredientsGroup in interface IRecipeLayoutIRecipeLayout.getItemStacks(),
IRecipeLayout.getFluidStacks()public void moveRecipeTransferButton(int posX,
int posY)
IRecipeLayoutmoveRecipeTransferButton in interface IRecipeLayoutpublic void setShapeless()
IRecipeLayoutsetShapeless in interface IRecipeLayout@Nullable public Focus<?> getFocus()
IRecipeLayoutgetFocus in interface IRecipeLayoutfor when you only care about a specific type of focus.@Nullable public <V> Focus<V> getFocus(IIngredientType<V> ingredientType)
IRecipeLayoutgetFocus in interface IRecipeLayout@Nullable public RecipeTransferButton getRecipeTransferButton()
public IRecipeCategory<?> getRecipeCategory()
IRecipeLayoutgetRecipeCategory in interface IRecipeLayoutpublic int getPosX()
public int getPosY()
public T getRecipe()