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)
IRecipeLayoutDrawable
IRecipeCategory.getBackground()
.setPosition
in interface IRecipeLayoutDrawable
public void drawRecipe(com.mojang.blaze3d.matrix.MatrixStack matrixStack, int mouseX, int mouseY)
IRecipeLayoutDrawable
drawRecipe
in interface IRecipeLayoutDrawable
public void drawOverlays(com.mojang.blaze3d.matrix.MatrixStack matrixStack, int mouseX, int mouseY)
IRecipeLayoutDrawable
drawOverlays
in interface IRecipeLayoutDrawable
public boolean isMouseOver(double mouseX, double mouseY)
IRecipeLayoutDrawable
isMouseOver
in interface IRecipeLayoutDrawable
@Nullable public java.lang.Object getIngredientUnderMouse(int mouseX, int mouseY)
IRecipeLayoutDrawable
getIngredientUnderMouse
in interface IRecipeLayoutDrawable
@Nullable public GuiIngredient<?> getGuiIngredientUnderMouse(double mouseX, double mouseY)
public boolean handleClick(double mouseX, double mouseY, int mouseButton)
public GuiItemStackGroup getItemStacks()
IRecipeLayout
getItemStacks
in interface IRecipeLayout
public IGuiFluidStackGroup getFluidStacks()
IRecipeLayout
getFluidStacks
in interface IRecipeLayout
public <V> IGuiIngredientGroup<V> getIngredientsGroup(IIngredientType<V> ingredientType)
IRecipeLayout
IModIngredientRegistration
.getIngredientsGroup
in interface IRecipeLayout
IRecipeLayout.getItemStacks()
,
IRecipeLayout.getFluidStacks()
public void moveRecipeTransferButton(int posX, int posY)
IRecipeLayout
moveRecipeTransferButton
in interface IRecipeLayout
public void setShapeless()
IRecipeLayout
setShapeless
in interface IRecipeLayout
@Nullable public Focus<?> getFocus()
IRecipeLayout
getFocus
in interface IRecipeLayout
for when you only care about a specific type of focus.
@Nullable public <V> Focus<V> getFocus(IIngredientType<V> ingredientType)
IRecipeLayout
getFocus
in interface IRecipeLayout
@Nullable public RecipeTransferButton getRecipeTransferButton()
public IRecipeCategory<?> getRecipeCategory()
IRecipeLayout
getRecipeCategory
in interface IRecipeLayout
public int getPosX()
public int getPosY()
public T getRecipe()