Class Button
java.lang.Object
net.minecraft.client.gui.components.AbstractWidget
net.minecraft.client.gui.components.AbstractButton
net.minecraft.client.gui.components.Button
- All Implemented Interfaces:
GuiEventListener,Renderable,TabOrderedElement,LayoutElement,NarratableEntry,NarrationSupplier,IAbstractWidgetExtension
- Direct Known Subclasses:
ExtendedButton,ImageButton,LockIconButton,MerchantScreen.TradeOfferButton,ModsButton,PageButton,PlainTextButton,RealmsResetWorldScreen.FrameButton,RealmsWorldSlotButton,SpriteIconButton
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic interfacestatic interfaceNested classes/interfaces inherited from interface net.minecraft.client.gui.narration.NarratableEntry
NarratableEntry.NarrationPriority -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intprotected final Button.CreateNarrationstatic final intprotected static final Button.CreateNarrationstatic final intstatic final intprotected final Button.OnPressstatic final intFields inherited from class net.minecraft.client.gui.components.AbstractButton
SPRITES, TEXT_MARGINFields inherited from class net.minecraft.client.gui.components.AbstractWidget
active, alpha, height, isHovered, packedFGColor, UNSET_FG_COLOR, visible, widthFields inherited from interface net.minecraft.client.gui.components.events.GuiEventListener
DOUBLE_CLICK_THRESHOLD_MS -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedButton(int pX, int pY, int pWidth, int pHeight, Component pMessage, Button.OnPress pOnPress, Button.CreateNarration pCreateNarration) protectedButton(Button.Builder builder) -
Method Summary
Modifier and TypeMethodDescriptionstatic Button.Builderbuilder(Component pMessage, Button.OnPress pOnPress) protected MutableComponentvoidonPress()voidupdateWidgetNarration(NarrationElementOutput pNarrationElementOutput) Methods inherited from class net.minecraft.client.gui.components.AbstractButton
keyPressed, onClick, renderString, renderWidgetMethods inherited from class net.minecraft.client.gui.components.AbstractWidget
clearFGColor, defaultButtonNarrationText, getBottom, getFGColor, getHeight, getMessage, getRectangle, getRight, getTabOrderGroup, getWidth, getX, getY, isActive, isFocused, isHovered, isHoveredOrFocused, isMouseOver, isValidClickButton, mouseClicked, mouseDragged, mouseReleased, narrationPriority, nextFocusPath, onDrag, onRelease, playButtonClickSound, playDownSound, render, renderScrollingString, renderScrollingString, renderScrollingString, setAlpha, setFGColor, setFocused, setHeight, setMessage, setRectangle, setSize, setTabOrderGroup, setTooltip, setTooltipDelay, setWidth, setX, setY, updateNarration, visitWidgets, wrapDefaultNarrationMessageMethods 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, keyReleased, mouseMoved, mouseScrolledMethods inherited from interface net.neoforged.neoforge.client.extensions.IAbstractWidgetExtension
onClickMethods inherited from interface net.minecraft.client.gui.layouts.LayoutElement
setPositionMethods inherited from interface net.minecraft.client.gui.narration.NarratableEntry
getNarratables
-
Field Details
-
SMALL_WIDTH
public static final int SMALL_WIDTH- See Also:
-
DEFAULT_WIDTH
public static final int DEFAULT_WIDTH- See Also:
-
BIG_WIDTH
public static final int BIG_WIDTH- See Also:
-
DEFAULT_HEIGHT
public static final int DEFAULT_HEIGHT- See Also:
-
DEFAULT_SPACING
public static final int DEFAULT_SPACING- See Also:
-
DEFAULT_NARRATION
-
onPress
-
createNarration
-
-
Constructor Details
-
Button
protected Button(int pX, int pY, int pWidth, int pHeight, Component pMessage, Button.OnPress pOnPress, Button.CreateNarration pCreateNarration) -
Button
-
-
Method Details
-
builder
-
onPress
public void onPress()- Specified by:
onPressin classAbstractButton
-
createNarrationMessage
- Overrides:
createNarrationMessagein classAbstractWidget
-
updateWidgetNarration
- Specified by:
updateWidgetNarrationin classAbstractWidget
-