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 int
private 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) boolean
private boolean
private static final float
private RecipeHolder
<?> private static final int
private static final int
private Minecraft
private static final ResourceLocation
private final List
<OverlayRecipeComponent.OverlayRecipeButton> (package private) float
private int
private int
Fields inherited from interface net.minecraft.client.gui.components.events.GuiEventListener
DOUBLE_CLICK_THRESHOLD_MS
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionRecipeHolder
<?> void
init
(Minecraft pMinecraft, RecipeCollection pCollection, int pX, int pY, int p_100199_, int p_100200_, float p_100201_) boolean
boolean
isMouseOver
(double pMouseX, double pMouseY) Checks if the given mouse coordinates are over the GUI element.boolean
boolean
mouseClicked
(double pMouseX, double pMouseY, int pButton) Called when a mouse button is clicked within the GUI element.void
render
(GuiGraphics pGuiGraphics, int pMouseX, int pMouseY, float pPartialTick) Renders the graphical user interface (GUI) element.void
setFocused
(boolean pFocused) Sets the focus state of the GUI element.void
setVisible
(boolean pIsVisible) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface net.minecraft.client.gui.components.events.GuiEventListener
charTyped, getCurrentFocusPath, getRectangle, keyPressed, keyReleased, mouseDragged, mouseMoved, mouseReleased, mouseScrolled, nextFocusPath
Methods 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 pMinecraft, RecipeCollection pCollection, int pX, int pY, int p_100199_, int p_100200_, float p_100201_) -
getRecipeCollection
-
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 interfaceGuiEventListener
- 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 interfaceGuiEventListener
- 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
Renders the graphical user interface (GUI) element.- Specified by:
render
in interfaceRenderable
- 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 interfaceGuiEventListener
- Parameters:
pFocused
-true
to apply focus,false
to remove focus
-
isFocused
public boolean isFocused()- Specified by:
isFocused
in interfaceGuiEventListener
-