Class OverlayRecipeComponent

java.lang.Object
net.minecraft.client.gui.screens.recipebook.OverlayRecipeComponent
All Implemented Interfaces:
GuiEventListener, Renderable, TabOrderedElement

public class OverlayRecipeComponent extends Object implements Renderable, GuiEventListener
  • Field Details

  • Constructor Details

    • OverlayRecipeComponent

      public OverlayRecipeComponent(SlotSelectTime slotSelectTime, boolean isFurnaceMenu)
  • Method Details

    • init

      public void init(RecipeCollection collection, ContextMap contextMap, boolean isFiltering, int x, int y, int overlayX, int overlayY, float width)
    • getRecipeCollection

      public RecipeCollection getRecipeCollection()
    • getLastRecipeClicked

      @Nullable public RecipeDisplayId getLastRecipeClicked()
    • mouseClicked

      public boolean mouseClicked(double mouseX, double mouseY, int button)
      Description copied from interface: GuiEventListener
      Called when a mouse button is clicked within the GUI element.

      Specified by:
      mouseClicked in interface GuiEventListener
      Parameters:
      mouseX - the X coordinate of the mouse.
      mouseY - the Y coordinate of the mouse.
      button - the button that was clicked.
      Returns:
      true if the event is consumed, false otherwise.
    • isMouseOver

      public boolean isMouseOver(double mouseX, double mouseY)
      Description copied from interface: GuiEventListener
      Checks if the given mouse coordinates are over the GUI element.

      Specified by:
      isMouseOver in interface GuiEventListener
      Parameters:
      mouseX - the X coordinate of the mouse.
      mouseY - the Y coordinate of the mouse.
      Returns:
      true if the mouse is over the GUI element, false otherwise.
    • render

      public void render(GuiGraphics p_281618_, int p_282646_, int p_283687_, float p_283147_)
      Description copied from interface: Renderable
      Renders the graphical user interface (GUI) element.
      Specified by:
      render in interface Renderable
      Parameters:
      p_281618_ - the GuiGraphics object used for rendering.
      p_282646_ - the x-coordinate of the mouse cursor.
      p_283687_ - the y-coordinate of the mouse cursor.
      p_283147_ - the partial tick time.
    • setVisible

      public void setVisible(boolean isVisible)
    • isVisible

      public boolean isVisible()
    • setFocused

      public void setFocused(boolean p_265597_)
      Description copied from interface: GuiEventListener
      Sets the focus state of the GUI element.
      Specified by:
      setFocused in interface GuiEventListener
      Parameters:
      p_265597_ - true to apply focus, false to remove focus
    • isFocused

      public boolean isFocused()
      Specified by:
      isFocused in interface GuiEventListener