Class AbstractContainerWidget
java.lang.Object
net.minecraft.client.gui.components.AbstractWidget
net.minecraft.client.gui.components.AbstractContainerWidget
- All Implemented Interfaces:
ContainerEventHandler
,GuiEventListener
,Renderable
,TabOrderedElement
,LayoutElement
,NarratableEntry
,NarrationSupplier
,IAbstractWidgetExtension
- Direct Known Subclasses:
AbstractSelectionList
,ConfigurationScreen.ConfigurationListScreen.ListLabelWidget
public abstract class AbstractContainerWidget
extends AbstractWidget
implements ContainerEventHandler
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.minecraft.client.gui.narration.NarratableEntry
NarratableEntry.NarrationPriority
-
Field Summary
FieldsFields 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
ConstructorsConstructorDescriptionAbstractContainerWidget
(int p_313730_, int p_313819_, int p_313847_, int p_313718_, Component p_313894_) -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
boolean
boolean
mouseClicked
(double p_313764_, double p_313832_, int p_313688_) Called when a mouse button is clicked within the GUI element.boolean
mouseDragged
(double p_313749_, double p_313887_, int p_313839_, double p_313844_, double p_313686_) Called when the mouse is dragged within the GUI element.boolean
mouseReleased
(double p_313886_, double p_313935_, int p_313751_) Called when a mouse button is released within the GUI element.nextFocusPath
(FocusNavigationEvent p_313949_) Retrieves the next focus path based on the given focus navigation event.final void
setDragging
(boolean p_313698_) Sets if the GUI element is dragging or not.void
setFocused
(boolean p_313936_) Sets the focus state of the GUI element.void
setFocused
(GuiEventListener p_313725_) Sets the focus state of the GUI element.Methods inherited from class net.minecraft.client.gui.components.AbstractWidget
clearFGColor, clicked, createNarrationMessage, defaultButtonNarrationText, getBottom, getFGColor, getHeight, getMessage, getRectangle, getRight, getTabOrderGroup, getTooltip, getWidth, getX, getY, isActive, isHovered, isHoveredOrFocused, isMouseOver, isValidClickButton, narrationPriority, onClick, onDrag, onRelease, playDownSound, render, renderScrollingString, renderScrollingString, renderScrollingString, renderWidget, setAlpha, setFGColor, setHeight, setMessage, setRectangle, setSize, setTabOrderGroup, setTooltip, setTooltipDelay, setWidth, setX, setY, updateNarration, updateWidgetNarration, 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.ContainerEventHandler
charTyped, children, getChildAt, getCurrentFocusPath, keyPressed, keyReleased, mouseScrolled
Methods inherited from interface net.minecraft.client.gui.components.events.GuiEventListener
getRectangle, isMouseOver, mouseMoved
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.components.TabOrderedElement
getTabOrderGroup
-
Field Details
-
focused
-
isDragging
private boolean isDragging
-
-
Constructor Details
-
AbstractContainerWidget
public AbstractContainerWidget(int p_313730_, int p_313819_, int p_313847_, int p_313718_, Component p_313894_)
-
-
Method Details
-
isDragging
public final boolean isDragging()- Specified by:
isDragging
in interfaceContainerEventHandler
-
setDragging
public final void setDragging(boolean p_313698_) Description copied from interface:ContainerEventHandler
Sets if the GUI element is dragging or not.- Specified by:
setDragging
in interfaceContainerEventHandler
- Parameters:
p_313698_
- the dragging state of the GUI element.
-
getFocused
- Specified by:
getFocused
in interfaceContainerEventHandler
-
setFocused
Description copied from interface:ContainerEventHandler
Sets the focus state of the GUI element.- Specified by:
setFocused
in interfaceContainerEventHandler
- Parameters:
p_313725_
- the focused GUI element.
-
mouseClicked
public boolean mouseClicked(double p_313764_, double p_313832_, int p_313688_) Description copied from class:AbstractWidget
Called when a mouse button is clicked within the GUI element.- Specified by:
mouseClicked
in interfaceContainerEventHandler
- Specified by:
mouseClicked
in interfaceGuiEventListener
- Overrides:
mouseClicked
in classAbstractWidget
- Parameters:
p_313764_
- the X coordinate of the mouse.p_313832_
- the Y coordinate of the mouse.p_313688_
- the button that was clicked.- Returns:
true
if the event is consumed,false
otherwise.
-
mouseReleased
public boolean mouseReleased(double p_313886_, double p_313935_, int p_313751_) Description copied from class:AbstractWidget
Called when a mouse button is released within the GUI element.- Specified by:
mouseReleased
in interfaceContainerEventHandler
- Specified by:
mouseReleased
in interfaceGuiEventListener
- Overrides:
mouseReleased
in classAbstractWidget
- Parameters:
p_313886_
- the X coordinate of the mouse.p_313935_
- the Y coordinate of the mouse.p_313751_
- the button that was released.- Returns:
true
if the event is consumed,false
otherwise.
-
mouseDragged
public boolean mouseDragged(double p_313749_, double p_313887_, int p_313839_, double p_313844_, double p_313686_) Description copied from class:AbstractWidget
Called when the mouse is dragged within the GUI element.- Specified by:
mouseDragged
in interfaceContainerEventHandler
- Specified by:
mouseDragged
in interfaceGuiEventListener
- Overrides:
mouseDragged
in classAbstractWidget
- Parameters:
p_313749_
- the X coordinate of the mouse.p_313887_
- the Y coordinate of the mouse.p_313839_
- the button that is being dragged.p_313844_
- the X distance of the drag.p_313686_
- the Y distance of the drag.- Returns:
true
if the event is consumed,false
otherwise.
-
isFocused
public boolean isFocused()- Specified by:
isFocused
in interfaceContainerEventHandler
- Specified by:
isFocused
in interfaceGuiEventListener
- Overrides:
isFocused
in classAbstractWidget
-
setFocused
public void setFocused(boolean p_313936_) Description copied from class:AbstractWidget
Sets the focus state of the GUI element.- Specified by:
setFocused
in interfaceContainerEventHandler
- Specified by:
setFocused
in interfaceGuiEventListener
- Overrides:
setFocused
in classAbstractWidget
- Parameters:
p_313936_
-true
to apply focus,false
to remove focus
-