Class RecipeAlternativesWidget

java.lang.Object
net.minecraft.client.gui.DrawableHelper
net.minecraft.client.gui.screen.recipebook.RecipeAlternativesWidget
All Implemented Interfaces:
Drawable, Element

@Environment(CLIENT)
public class RecipeAlternativesWidget
extends DrawableHelper
implements Drawable, Element
  • Field Details

  • 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:
      changeFocus in interface Element
      Parameters:
      lookForwards - true to cycle forwards, otherwise cycle backwards
      Returns:
      true to indicate that the event handling is successful/valid
    • getResults

      public RecipeResultCollection getResults()
    • getLastClickedRecipe

      public Recipe<?> 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 in GLFW class.
      Specified by:
      mouseClicked in interface Element
      Parameters:
      mouseX - the X coordinate of the mouse
      mouseY - the Y coordinate of the mouse
      button - the mouse button number
      Returns:
      true to 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:
      isMouseOver in interface Element
      Parameters:
      mouseX - the X coordinate of the mouse
      mouseY - the Y coordinate of the mouse
      Returns:
      true if the mouse is within the bound of the element, otherwise false
    • render

      public void render​(MatrixStack matrices, int mouseX, int mouseY, float delta)
      Specified by:
      render in interface Drawable
    • 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()