Class RecipeButton
java.lang.Object
net.minecraft.client.gui.components.AbstractWidget
net.minecraft.client.gui.screens.recipebook.RecipeButton
- All Implemented Interfaces:
GuiEventListener
,Renderable
,TabOrderedElement
,LayoutElement
,NarratableEntry
,NarrationSupplier
,IAbstractWidgetExtension
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static final record
Nested classes/interfaces inherited from interface net.minecraft.client.gui.narration.NarratableEntry
NarratableEntry.NarrationPriority
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate boolean
private static final float
private float
private static final int
private RecipeCollection
private static final Component
private List
<RecipeButton.ResolvedEntry> private static final ResourceLocation
private static final ResourceLocation
private static final ResourceLocation
private static final ResourceLocation
private final SlotSelectTime
Fields inherited from class net.minecraft.client.gui.components.AbstractWidget
active, alpha, height, isHovered, packedFGColor, UNSET_FG_COLOR, visible, width
Fields inherited from interface net.minecraft.client.gui.components.events.GuiEventListener
DOUBLE_CLICK_THRESHOLD_MS
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static boolean
getTooltipText
(ItemStack p_379408_) int
getWidth()
private boolean
void
init
(RecipeCollection p_100480_, boolean p_360894_, RecipeBookPage p_100481_, ContextMap p_381053_) boolean
protected boolean
isValidClickButton
(int p_100473_) void
renderWidget
(GuiGraphics p_281385_, int p_282779_, int p_282744_, float p_282439_) void
updateWidgetNarration
(NarrationElementOutput p_170060_) Methods inherited from class net.minecraft.client.gui.components.AbstractWidget
clearFGColor, createNarrationMessage, defaultButtonNarrationText, getBottom, getFGColor, getHeight, getMessage, getRectangle, getRight, getTabOrderGroup, getTooltip, getX, getY, isActive, isFocused, isHovered, isHoveredOrFocused, isMouseOver, mouseClicked, mouseDragged, mouseReleased, narrationPriority, nextFocusPath, onClick, onDrag, onRelease, playButtonClickSound, playDownSound, render, renderScrollingString, renderScrollingString, renderScrollingString, setAlpha, setFGColor, setFocused, setHeight, setMessage, setRectangle, setSize, setTabOrderGroup, setTooltip, setTooltipDelay, setWidth, setX, setY, updateNarration, visitWidgets, wrapDefaultNarrationMessage
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, getBorderForArrowNavigation, getCurrentFocusPath, keyPressed, keyReleased, mouseMoved, mouseScrolled
Methods inherited from interface net.neoforged.neoforge.client.extensions.IAbstractWidgetExtension
onClick
Methods inherited from interface net.minecraft.client.gui.layouts.LayoutElement
setPosition
Methods inherited from interface net.minecraft.client.gui.narration.NarratableEntry
getNarratables
-
Field Details
-
SLOT_MANY_CRAFTABLE_SPRITE
-
SLOT_CRAFTABLE_SPRITE
-
SLOT_MANY_UNCRAFTABLE_SPRITE
-
SLOT_UNCRAFTABLE_SPRITE
-
ANIMATION_TIME
private static final float ANIMATION_TIME- See Also:
-
BACKGROUND_SIZE
private static final int BACKGROUND_SIZE- See Also:
-
MORE_RECIPES_TOOLTIP
-
collection
-
selectedEntries
-
allRecipesHaveSameResultDisplay
private boolean allRecipesHaveSameResultDisplay -
slotSelectTime
-
animationTime
private float animationTime
-
-
Constructor Details
-
RecipeButton
-
-
Method Details
-
init
public void init(RecipeCollection p_100480_, boolean p_360894_, RecipeBookPage p_100481_, ContextMap p_381053_) -
allRecipesHaveSameResultDisplay
-
getCollection
-
renderWidget
- Specified by:
renderWidget
in classAbstractWidget
-
hasMultipleRecipes
private boolean hasMultipleRecipes() -
isOnlyOption
public boolean isOnlyOption() -
getCurrentRecipe
-
getDisplayStack
-
getTooltipText
-
updateWidgetNarration
- Specified by:
updateWidgetNarration
in classAbstractWidget
-
getWidth
public int getWidth()- Specified by:
getWidth
in interfaceLayoutElement
- Overrides:
getWidth
in classAbstractWidget
-
isValidClickButton
protected boolean isValidClickButton(int p_100473_) - Overrides:
isValidClickButton
in classAbstractWidget
-