Package net.minecraft.client.gui.widget
Class EntryListWidget<E extends EntryListWidget.Entry<E>>
java.lang.Object
net.minecraft.client.gui.DrawableHelper
net.minecraft.client.gui.AbstractParentElement
net.minecraft.client.gui.widget.EntryListWidget<E>
- All Implemented Interfaces:
Drawable,Element,ParentElement
- Direct Known Subclasses:
AlwaysSelectedEntryListWidget,ElementListWidget
@Environment(CLIENT) public abstract class EntryListWidget<E extends EntryListWidget.Entry<E>> extends AbstractParentElement implements Drawable
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classEntryListWidget.class_5403(package private) classEntryListWidget.Entriesstatic classEntryListWidget.Entry<E extends EntryListWidget.Entry<E>> -
Field Summary
Fields Modifier and Type Field Description protected intbottomprotected booleancenterListVerticallyprivate List<E>childrenprotected MinecraftClientclientprotected intheaderHeightprotected intheightprotected intitemHeightprotected intleftprivate booleanrenderHeaderprivate booleanrenderSelectionprotected intrightprivate doublescrollAmountprivate booleanscrollingprivate Eselectedprotected inttopprotected intwidthFields inherited from class net.minecraft.client.gui.DrawableHelper
BACKGROUND_TEXTURE, GUI_ICONS_TEXTURE, STATS_ICON_TEXTURE -
Constructor Summary
Constructors Constructor Description EntryListWidget(MinecraftClient client, int width, int height, int top, int bottom, int itemHeight) -
Method Summary
Modifier and Type Method Description protected intaddEntry(E entry)protected voidcenterScrollOn(E entry)List<E>children()protected voidclearEntries()protected voidclickedHeader(int x, int y)protected voidensureVisible(E entry)protected EgetEntry(int index)protected EgetEntryAtPosition(double x, double y)EgetFocused()protected intgetItemCount()protected intgetMaxPosition()private intgetMaxScroll()private intgetRowBottom(int index)protected intgetRowLeft()protected intgetRowTop(int index)intgetRowWidth()doublegetScrollAmount()protected intgetScrollbarPositionX()EgetSelected()protected booleanisFocused()booleanisMouseOver(double mouseX, double mouseY)protected booleanisSelectedItem(int index)booleankeyPressed(int keyCode, int scanCode, int modifiers)voidmethod_29344(boolean bool)private voidmethod_29621(EntryListWidget.Entry<E> entry)protected voidmethod_30013(EntryListWidget.class_5403 class_5403, Predicate<E> predicate)protected voidmethod_30015()booleanmouseClicked(double mouseX, double mouseY, int button)booleanmouseDragged(double mouseX, double mouseY, int button, double deltaX, double deltaY)booleanmouseReleased(double mouseX, double mouseY, int button)booleanmouseScrolled(double mouseX, double mouseY, double amount)protected voidmoveSelection(EntryListWidget.class_5403 class_5403)protected Eremove(int index)protected booleanremoveEntry(E entry)voidrender(MatrixStack matrices, int mouseX, int mouseY, float delta)protected voidrenderBackground(MatrixStack matrixStack)protected voidrenderDecorations(MatrixStack matrixStack, int int2, int int3)protected voidrenderHeader(MatrixStack matrices, int x, int y, Tessellator tessellator)protected voidrenderList(MatrixStack matrixStack, int int2, int int3, int int4, int int5, float float2)protected voidreplaceEntries(Collection<E> newEntries)private voidscroll(int amount)voidsetLeftPos(int left)protected voidsetRenderHeader(boolean renderHeader, int headerHeight)voidsetScrollAmount(double amount)voidsetSelected(E entry)protected voidupdateScrollingState(double mouseX, double mouseY, int button)voidupdateSize(int width, int height, int top, int bottom)Methods inherited from class net.minecraft.client.gui.AbstractParentElement
isDragging, setDragging, setFocusedMethods inherited from class net.minecraft.client.gui.DrawableHelper
drawCenteredString, drawCenteredText, drawHorizontalLine, drawSprite, drawStringWithShadow, drawTexture, drawTexture, drawTexture, drawTexture, drawTextWithShadow, drawVerticalLine, fill, fillGradient, fillGradient, getZOffset, method_29343, setZOffsetMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.minecraft.client.gui.ParentElement
changeFocus, charTyped, focusOn, hoveredElement, keyReleased, setInitialFocus
-
Field Details
-
client
-
itemHeight
protected final int itemHeight -
children
-
width
protected int width -
height
protected int height -
top
protected int top -
bottom
protected int bottom -
right
protected int right -
left
protected int left -
centerListVertically
protected boolean centerListVertically -
scrollAmount
private double scrollAmount -
renderSelection
private boolean renderSelection -
renderHeader
private boolean renderHeader -
headerHeight
protected int headerHeight -
scrolling
private boolean scrolling -
selected
-
-
Constructor Details
-
EntryListWidget
public EntryListWidget(MinecraftClient client, int width, int height, int top, int bottom, int itemHeight)
-
-
Method Details
-
method_29344
public void method_29344(boolean bool) -
setRenderHeader
protected void setRenderHeader(boolean renderHeader, int headerHeight) -
getRowWidth
public int getRowWidth() -
getSelected
-
setSelected
-
getFocused
- Specified by:
getFocusedin interfaceParentElement- Overrides:
getFocusedin classAbstractParentElement
-
children
- Specified by:
childrenin interfaceParentElement
-
clearEntries
protected final void clearEntries() -
replaceEntries
-
getEntry
-
addEntry
-
getItemCount
protected int getItemCount() -
isSelectedItem
protected boolean isSelectedItem(int index) -
getEntryAtPosition
-
updateSize
public void updateSize(int width, int height, int top, int bottom) -
setLeftPos
public void setLeftPos(int left) -
getMaxPosition
protected int getMaxPosition() -
clickedHeader
protected void clickedHeader(int x, int y) -
renderHeader
-
renderBackground
-
renderDecorations
-
render
-
centerScrollOn
-
ensureVisible
-
scroll
private void scroll(int amount) -
getScrollAmount
public double getScrollAmount() -
setScrollAmount
public void setScrollAmount(double amount) -
getMaxScroll
private int getMaxScroll() -
updateScrollingState
protected void updateScrollingState(double mouseX, double mouseY, int button) -
getScrollbarPositionX
protected int getScrollbarPositionX() -
mouseClicked
public boolean mouseClicked(double mouseX, double mouseY, int button)- Specified by:
mouseClickedin interfaceElement- Specified by:
mouseClickedin interfaceParentElement
-
mouseReleased
public boolean mouseReleased(double mouseX, double mouseY, int button)- Specified by:
mouseReleasedin interfaceElement- Specified by:
mouseReleasedin interfaceParentElement
-
mouseDragged
public boolean mouseDragged(double mouseX, double mouseY, int button, double deltaX, double deltaY)- Specified by:
mouseDraggedin interfaceElement- Specified by:
mouseDraggedin interfaceParentElement
-
mouseScrolled
public boolean mouseScrolled(double mouseX, double mouseY, double amount)- Specified by:
mouseScrolledin interfaceElement- Specified by:
mouseScrolledin interfaceParentElement
-
keyPressed
public boolean keyPressed(int keyCode, int scanCode, int modifiers)- Specified by:
keyPressedin interfaceElement- Specified by:
keyPressedin interfaceParentElement
-
moveSelection
-
method_30015
protected void method_30015() -
method_30013
-
isMouseOver
public boolean isMouseOver(double mouseX, double mouseY)- Specified by:
isMouseOverin interfaceElement
-
renderList
protected void renderList(MatrixStack matrixStack, int int2, int int3, int int4, int int5, float float2) -
getRowLeft
protected int getRowLeft() -
getRowTop
protected int getRowTop(int index) -
getRowBottom
private int getRowBottom(int index) -
isFocused
protected boolean isFocused() -
remove
-
removeEntry
-
method_29621
-