public class GuiIngredientGroup<T> extends java.lang.Object implements IGuiIngredientGroup<T>
Constructor and Description |
---|
GuiIngredientGroup(IIngredientType<T> ingredientType,
Focus<T> focus,
int cycleOffset) |
Modifier and Type | Method and Description |
---|---|
void |
addTooltipCallback(ITooltipCallback<T> tooltipCallback)
Add a callback to alter the tooltip for these ingredients.
|
void |
draw(com.mojang.blaze3d.matrix.MatrixStack matrixStack,
int xOffset,
int yOffset,
int highlightColor,
int mouseX,
int mouseY) |
java.util.Map<java.lang.Integer,GuiIngredient<T>> |
getGuiIngredients()
Get the ingredients after they have been set.
|
GuiIngredient<T> |
getHoveredIngredient(int xOffset,
int yOffset,
double mouseX,
double mouseY) |
java.lang.String |
getIngredientModId(T ingredient) |
java.util.Set<java.lang.Integer> |
getOutputSlots() |
void |
init(int slotIndex,
boolean input,
IIngredientRenderer<T> ingredientRenderer,
int xPosition,
int yPosition,
int width,
int height,
int xPadding,
int yPadding)
Initialize a custom guiIngredient for the given slot.
|
void |
init(int slotIndex,
boolean input,
int xPosition,
int yPosition)
Initialize a guiIngredient for the given slot.
|
void |
set(IIngredients ingredients)
Set all the ingredients in the group, based on the
IIngredients
passed to IRecipeCategory.setRecipe(IRecipeLayout, Object, IIngredients) . |
void |
set(int slotIndex,
java.util.List<T> ingredients)
Set the ingredient at slotIndex to a rotating collection of ingredients.
|
void |
set(int slotIndex,
T value)
Set the ingredient at slotIndex to a specific ingredient.
|
void |
setBackground(int slotIndex,
IDrawable background)
Set a background image to draw behind the ingredient.
|
void |
setOverrideDisplayFocus(IFocus<T> focus) |
public GuiIngredientGroup(IIngredientType<T> ingredientType, @Nullable Focus<T> focus, int cycleOffset)
public void init(int slotIndex, boolean input, int xPosition, int yPosition)
IGuiIngredientGroup
IModIngredientRegistration
.
Uses the default IIngredientRenderer
registered for the ingredient list in IModIngredientRegistration.register(IIngredientType, Collection, IIngredientHelper, IIngredientRenderer)
Uses the same 16x16 size as the ingredient list.
For more advanced control over rendering, use IGuiIngredientGroup.init(int, boolean, IIngredientRenderer, int, int, int, int, int, int)
init
in interface IGuiIngredientGroup<T>
slotIndex
- the slot index of this ingredientinput
- whether this slot is an inputxPosition
- x position relative to the recipe backgroundyPosition
- y position relative to the recipe backgroundIGuiItemStackGroup.init(int, boolean, int, int)
,
IGuiFluidStackGroup.init(int, boolean, int, int, int, int, int, boolean, IDrawable)
public void init(int slotIndex, boolean input, IIngredientRenderer<T> ingredientRenderer, int xPosition, int yPosition, int width, int height, int xPadding, int yPadding)
IGuiIngredientGroup
IGuiIngredientGroup.init(int, boolean, int, int)
.
For FluidStack, see IGuiFluidStackGroup.init(int, boolean, int, int, int, int, int, boolean, IDrawable)
This can handle mod ingredients registered with IModIngredientRegistration
.init
in interface IGuiIngredientGroup<T>
slotIndex
- the slot index of this ingredientinput
- whether this slot is an inputingredientRenderer
- the ingredient renderer for this ingredientxPosition
- x position relative to the recipe backgroundyPosition
- y position relative to the recipe backgroundwidth
- width of this ingredientheight
- height of this ingredientxPadding
- the extra x padding added to each side when drawing the ingredientyPadding
- the extra y padding added to each side when drawing the ingredientIGuiItemStackGroup.init(int, boolean, int, int)
,
IGuiFluidStackGroup.init(int, boolean, int, int, int, int, int, boolean, IDrawable)
public void set(IIngredients ingredients)
IGuiIngredientGroup
IIngredients
passed to IRecipeCategory.setRecipe(IRecipeLayout, Object, IIngredients)
.set
in interface IGuiIngredientGroup<T>
public void set(int slotIndex, @Nullable java.util.List<T> ingredients)
IGuiIngredientGroup
set
in interface IGuiIngredientGroup<T>
public void set(int slotIndex, @Nullable T value)
IGuiIngredientGroup
set
in interface IGuiIngredientGroup<T>
public void setBackground(int slotIndex, IDrawable background)
IGuiIngredientGroup
setBackground
in interface IGuiIngredientGroup<T>
public void addTooltipCallback(ITooltipCallback<T> tooltipCallback)
IGuiIngredientGroup
addTooltipCallback
in interface IGuiIngredientGroup<T>
public java.util.Map<java.lang.Integer,GuiIngredient<T>> getGuiIngredients()
IGuiIngredientGroup
getGuiIngredients
in interface IGuiIngredientGroup<T>
@Nullable public GuiIngredient<T> getHoveredIngredient(int xOffset, int yOffset, double mouseX, double mouseY)
public void draw(com.mojang.blaze3d.matrix.MatrixStack matrixStack, int xOffset, int yOffset, int highlightColor, int mouseX, int mouseY)
public void setOverrideDisplayFocus(@Nullable IFocus<T> focus)
setOverrideDisplayFocus
in interface IGuiIngredientGroup<T>
public java.util.Set<java.lang.Integer> getOutputSlots()
public java.lang.String getIngredientModId(T ingredient)