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 -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intprivate RecipeCollection(package private) static final ResourceLocation(package private) static final ResourceLocation(package private) static final ResourceLocation(package private) static final ResourceLocation(package private) static final ResourceLocation(package private) static final ResourceLocation(package private) static final ResourceLocation(package private) static final ResourceLocation(package private) booleanprivate booleanprivate static final floatprivate RecipeHolder<?> private static final intprivate static final intprivate Minecraftprivate static final ResourceLocationprivate final List<OverlayRecipeComponent.OverlayRecipeButton> (package private) floatprivate intprivate intFields inherited from interface net.minecraft.client.gui.components.events.GuiEventListener
DOUBLE_CLICK_THRESHOLD_MS -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionRecipeHolder<?> voidinit(Minecraft minecraft, RecipeCollection collection, int x, int y, int p_100199_, int p_100200_, float p_100201_) booleanbooleanisMouseOver(double mouseX, double mouseY) Checks if the given mouse coordinates are over the GUI element.booleanbooleanmouseClicked(double mouseX, double mouseY, int button) Called when a mouse button is clicked within the GUI element.voidrender(GuiGraphics guiGraphics, int mouseX, int mouseY, float partialTick) Renders the graphical user interface (GUI) element.voidsetFocused(boolean focused) Sets the focus state of the GUI element.voidsetVisible(boolean isVisible) 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, getCurrentFocusPath, getRectangle, keyPressed, keyReleased, mouseDragged, mouseMoved, mouseReleased, mouseScrolled, nextFocusPathMethods inherited from interface net.minecraft.client.gui.components.TabOrderedElement
getTabOrderGroup
-
Field Details
-
OVERLAY_RECIPE_SPRITE
-
FURNACE_OVERLAY_HIGHLIGHTED_SPRITE
-
FURNACE_OVERLAY_SPRITE
-
CRAFTING_OVERLAY_HIGHLIGHTED_SPRITE
-
CRAFTING_OVERLAY_SPRITE
-
FURNACE_OVERLAY_DISABLED_HIGHLIGHTED_SPRITE
-
FURNACE_OVERLAY_DISABLED_SPRITE
-
CRAFTING_OVERLAY_DISABLED_HIGHLIGHTED_SPRITE
-
CRAFTING_OVERLAY_DISABLED_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 -
minecraft
-
collection
-
lastRecipeClicked
-
time
float time -
isFurnaceMenu
boolean isFurnaceMenu
-
-
Constructor Details
-
OverlayRecipeComponent
public OverlayRecipeComponent()
-
-
Method Details
-
init
public void init(Minecraft minecraft, RecipeCollection collection, int x, int y, int p_100199_, int p_100200_, float p_100201_) -
getRecipeCollection
-
getLastRecipeClicked
-
mouseClicked
public boolean mouseClicked(double mouseX, double mouseY, int button) Called when a mouse button is clicked within the GUI element.- Specified by:
mouseClickedin interfaceGuiEventListener- Parameters:
mouseX- the X coordinate of the mouse.mouseY- the Y coordinate of the mouse.button- the button that was clicked.- Returns:
trueif the event is consumed,falseotherwise.
-
isMouseOver
public boolean isMouseOver(double mouseX, double mouseY) Checks if the given mouse coordinates are over the GUI element.- Specified by:
isMouseOverin interfaceGuiEventListener- Parameters:
mouseX- the X coordinate of the mouse.mouseY- the Y coordinate of the mouse.- Returns:
trueif the mouse is over the GUI element,falseotherwise.
-
render
Renders the graphical user interface (GUI) element.- Specified by:
renderin interfaceRenderable- Parameters:
guiGraphics- the GuiGraphics object used for rendering.mouseX- the x-coordinate of the mouse cursor.mouseY- the y-coordinate of the mouse cursor.partialTick- the partial tick time.
-
setVisible
public void setVisible(boolean isVisible) -
isVisible
public boolean isVisible() -
setFocused
public void setFocused(boolean focused) Sets the focus state of the GUI element.- Specified by:
setFocusedin interfaceGuiEventListener- Parameters:
focused-trueto apply focus,falseto remove focus
-
isFocused
public boolean isFocused()- Specified by:
isFocusedin interfaceGuiEventListener
-