Class RecipeAlternativesWidget
java.lang.Object
net.minecraft.client.gui.DrawableHelper
net.minecraft.client.gui.screen.recipebook.RecipeAlternativesWidget
@Environment(CLIENT) public class RecipeAlternativesWidget extends DrawableHelper implements Drawable, Element
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) classRecipeAlternativesWidget.AlternativeButtonWidget(package private) classRecipeAlternativesWidget.FurnaceAlternativeButtonWidget -
Field Summary
Fields Modifier and Type Field Description private List<RecipeAlternativesWidget.AlternativeButtonWidget>alternativeButtonsprivate static IdentifierBACKGROUND_TEXTUREprivate intbuttonXprivate intbuttonYprivate MinecraftClientclientprivate booleanfurnaceprivate Recipe<?>lastClickedRecipeprivate RecipeResultCollectionresultCollectionprivate floattimeprivate booleanvisibleFields inherited from class net.minecraft.client.gui.DrawableHelper
GUI_ICONS_TEXTURE, OPTIONS_BACKGROUND_TEXTURE, STATS_ICON_TEXTURE -
Constructor Summary
Constructors Constructor Description RecipeAlternativesWidget() -
Method Summary
Modifier and Type Method Description booleanchangeFocus(boolean lookForwards)Changes the focusing element by cycling to the next/previous element.Recipe<?>getLastClickedRecipe()RecipeResultCollectiongetResults()booleanisMouseOver(double mouseX, double mouseY)Checks if the mouse position is within the bound of the element.booleanisVisible()booleanmouseClicked(double mouseX, double mouseY, int button)Callback for when a mouse button down event has been captured.voidrender(MatrixStack matrices, int mouseX, int mouseY, float delta)private voidrenderGrid(MatrixStack matrixStack, int int2, int int3, int int4, int int5, int int6, int int7)voidsetVisible(boolean visible)voidshowAlternativesForResult(MinecraftClient client, RecipeResultCollection results, int buttonX, int buttonY, int areaCenterX, int areaCenterY, float delta)Methods inherited from class net.minecraft.client.gui.DrawableHelper
drawCenteredString, drawCenteredText, drawHorizontalLine, drawSprite, drawStringWithShadow, drawTexture, drawTexture, drawTexture, drawTexture, drawTextWithShadow, drawVerticalLine, fill, fillGradient, fillGradient, getZOffset, method_29343, method_33284, setZOffsetMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.minecraft.client.gui.Element
charTyped, keyPressed, keyReleased, mouseDragged, mouseMoved, mouseReleased, mouseScrolled
-
Field Details
-
BACKGROUND_TEXTURE
-
alternativeButtons
-
visible
private boolean visible -
buttonX
private int buttonX -
buttonY
private int buttonY -
client
-
resultCollection
-
lastClickedRecipe
-
time
private float time -
furnace
private boolean furnace
-
-
Constructor Details
-
RecipeAlternativesWidget
public RecipeAlternativesWidget()
-
-
Method Details
-
showAlternativesForResult
public void showAlternativesForResult(MinecraftClient client, RecipeResultCollection results, int buttonX, int buttonY, int areaCenterX, int areaCenterY, float delta) -
changeFocus
public boolean changeFocus(boolean lookForwards)Changes the focusing element by cycling to the next/previous element. This action is done typically when the user has pressed the 'Tab' or 'Ctrl+Tab' key.- Specified by:
changeFocusin interfaceElement- Parameters:
lookForwards-trueto cycle forwards, otherwise cycle backwards- Returns:
trueto indicate that the event handling is successful/valid
-
getResults
-
getLastClickedRecipe
-
mouseClicked
public boolean mouseClicked(double mouseX, double mouseY, int button)Callback for when a mouse button down event has been captured. The button number is identified by the constants inGLFWclass.- Specified by:
mouseClickedin interfaceElement- Parameters:
mouseX- the X coordinate of the mousemouseY- the Y coordinate of the mousebutton- the mouse button number- Returns:
trueto indicate that the event handling is successful/valid- See Also:
Mouse.onMouseButton(long, int, int, int),GLFW.GLFW_MOUSE_BUTTON_1
-
isMouseOver
public boolean isMouseOver(double mouseX, double mouseY)Checks if the mouse position is within the bound of the element.- Specified by:
isMouseOverin interfaceElement- Parameters:
mouseX- the X coordinate of the mousemouseY- the Y coordinate of the mouse- Returns:
trueif the mouse is within the bound of the element, otherwisefalse
-
render
-
renderGrid
private void renderGrid(MatrixStack matrixStack, int int2, int int3, int int4, int int5, int int6, int int7) -
setVisible
public void setVisible(boolean visible) -
isVisible
public boolean isVisible()
-