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 pSlotSelectTime, boolean pIsFurnaceMenu)
  • Method Details

    • init

      public void init(RecipeCollection pCollection, ContextMap pContextMap, boolean pIsFiltering, int pX, int pY, int pOverlayX, int pOverlayY, float pWidth)
    • getRecipeCollection

      public RecipeCollection getRecipeCollection()
    • getLastRecipeClicked

      @Nullable public RecipeDisplayId getLastRecipeClicked()
    • mouseClicked

      public boolean mouseClicked(double pMouseX, double pMouseY, int pButton)
      Called when a mouse button is clicked within the GUI element.

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

      public boolean isMouseOver(double pMouseX, double pMouseY)
      Checks if the given mouse coordinates are over the GUI element.

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

      public void render(GuiGraphics pGuiGraphics, int pMouseX, int pMouseY, float pPartialTick)
      Renders the graphical user interface (GUI) element.
      Specified by:
      render in interface Renderable
      Parameters:
      pGuiGraphics - the GuiGraphics object used for rendering.
      pMouseX - the x-coordinate of the mouse cursor.
      pMouseY - the y-coordinate of the mouse cursor.
      pPartialTick - the partial tick time.
    • setVisible

      public void setVisible(boolean pIsVisible)
    • isVisible

      public boolean isVisible()
    • setFocused

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

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