Class OverlayRecipeComponent
java.lang.Object
net.minecraft.client.gui.screens.recipebook.OverlayRecipeComponent
- All Implemented Interfaces:
GuiEventListener,Renderable,TabOrderedElement
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) class(package private) class(package private) class -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intprivate RecipeCollectionprivate final booleanprivate booleanprivate static final floatprivate RecipeDisplayIdprivate static final intprivate static final intprivate static final ResourceLocationprivate final List<OverlayRecipeComponent.OverlayRecipeButton> (package private) final SlotSelectTimeprivate intprivate intFields inherited from interface net.minecraft.client.gui.components.events.GuiEventListener
DOUBLE_CLICK_THRESHOLD_MS -
Constructor Summary
ConstructorsConstructorDescriptionOverlayRecipeComponent(SlotSelectTime pSlotSelectTime, boolean pIsFurnaceMenu) -
Method Summary
Modifier and TypeMethodDescriptionvoidinit(RecipeCollection pCollection, ContextMap pContextMap, boolean pIsFiltering, int pX, int pY, int pOverlayX, int pOverlayY, float pWidth) booleanbooleanisMouseOver(double pMouseX, double pMouseY) Checks if the given mouse coordinates are over the GUI element.booleanbooleanmouseClicked(double pMouseX, double pMouseY, int pButton) Called when a mouse button is clicked within the GUI element.voidrender(GuiGraphics p_281618_, int p_282646_, int p_283687_, float p_283147_) Renders the graphical user interface (GUI) element.voidsetFocused(boolean p_265597_) Sets the focus state of the GUI element.voidsetVisible(boolean pIsVisible) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.minecraft.client.gui.components.events.GuiEventListener
charTyped, getBorderForArrowNavigation, getCurrentFocusPath, getRectangle, keyPressed, keyReleased, mouseDragged, mouseMoved, mouseReleased, mouseScrolled, nextFocusPathMethods inherited from interface net.minecraft.client.gui.components.TabOrderedElement
getTabOrderGroup
-
Field Details
-
OVERLAY_RECIPE_SPRITE
-
MAX_ROW
private static final int MAX_ROW- See Also:
-
MAX_ROW_LARGE
private static final int MAX_ROW_LARGE- See Also:
-
ITEM_RENDER_SCALE
private static final float ITEM_RENDER_SCALE- See Also:
-
BUTTON_SIZE
public static final int BUTTON_SIZE- See Also:
-
recipeButtons
-
isVisible
private boolean isVisible -
x
private int x -
y
private int y -
collection
-
lastRecipeClicked
-
slotSelectTime
-
isFurnaceMenu
private final boolean isFurnaceMenu
-
-
Constructor Details
-
OverlayRecipeComponent
-
-
Method Details
-
init
public void init(RecipeCollection pCollection, ContextMap pContextMap, boolean pIsFiltering, int pX, int pY, int pOverlayX, int pOverlayY, float pWidth) -
getRecipeCollection
-
getLastRecipeClicked
-
mouseClicked
public boolean mouseClicked(double pMouseX, double pMouseY, int pButton) Description copied from interface:GuiEventListenerCalled when a mouse button is clicked within the GUI element.- Specified by:
mouseClickedin interfaceGuiEventListener- Parameters:
pMouseX- the X coordinate of the mouse.pMouseY- the Y coordinate of the mouse.pButton- the button that was clicked.- Returns:
trueif the event is consumed,falseotherwise.
-
isMouseOver
public boolean isMouseOver(double pMouseX, double pMouseY) Description copied from interface:GuiEventListenerChecks if the given mouse coordinates are over the GUI element.- Specified by:
isMouseOverin interfaceGuiEventListener- Parameters:
pMouseX- the X coordinate of the mouse.pMouseY- the Y coordinate of the mouse.- Returns:
trueif the mouse is over the GUI element,falseotherwise.
-
render
Description copied from interface:RenderableRenders the graphical user interface (GUI) element.- Specified by:
renderin interfaceRenderable- 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 pIsVisible) -
isVisible
public boolean isVisible() -
setFocused
public void setFocused(boolean p_265597_) Description copied from interface:GuiEventListenerSets the focus state of the GUI element.- Specified by:
setFocusedin interfaceGuiEventListener- Parameters:
p_265597_-trueto apply focus,falseto remove focus
-
isFocused
public boolean isFocused()- Specified by:
isFocusedin interfaceGuiEventListener
-