Class AbstractList<E extends AbstractList.AbstractListEntry<E>>
- java.lang.Object
-
- net.minecraft.client.gui.AbstractGui
-
- net.minecraft.client.gui.FocusableGui
-
- net.minecraft.client.gui.widget.list.AbstractList<E>
-
- All Implemented Interfaces:
IGuiEventListener
,INestedGuiEventHandler
,IRenderable
- Direct Known Subclasses:
AbstractOptionList
,ExtendedList
public abstract class AbstractList<E extends AbstractList.AbstractListEntry<E>> extends FocusableGui implements IRenderable
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
AbstractList.AbstractListEntry<E extends AbstractList.AbstractListEntry<E>>
static class
AbstractList.Ordering
(package private) class
AbstractList.SimpleArrayList
-
Field Summary
Fields Modifier and Type Field Description protected boolean
centerListVertically
private java.util.List<E>
children
protected int
headerHeight
protected int
height
protected int
itemHeight
protected Minecraft
minecraft
private boolean
renderBackground
private boolean
renderHeader
private boolean
renderSelection
private boolean
renderTopAndBottom
private double
scrollAmount
private boolean
scrolling
private E
selected
protected int
width
protected int
x0
protected int
x1
protected int
y0
protected int
y1
-
Fields inherited from class net.minecraft.client.gui.AbstractGui
BACKGROUND_LOCATION, GUI_ICONS_LOCATION, STATS_ICON_LOCATION
-
-
Constructor Summary
Constructors Constructor Description AbstractList(Minecraft p_i51146_1_, int p_i51146_2_, int p_i51146_3_, int p_i51146_4_, int p_i51146_5_, int p_i51146_6_)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected int
addEntry(E p_230513_1_)
private void
bindEntryToSelf(AbstractList.AbstractListEntry<E> p_238480_1_)
protected void
centerScrollOn(E p_230951_1_)
java.util.List<E>
children()
protected void
clearEntries()
protected void
clickedHeader(int p_230938_1_, int p_230938_2_)
protected void
ensureVisible(E p_230954_1_)
int
getBottom()
protected E
getEntry(int p_230953_1_)
protected E
getEntryAtPosition(double p_230933_1_, double p_230933_3_)
E
getFocused()
int
getHeight()
protected int
getItemCount()
int
getLeft()
protected int
getMaxPosition()
int
getMaxScroll()
int
getRight()
private int
getRowBottom(int p_230948_1_)
int
getRowLeft()
int
getRowRight()
protected int
getRowTop(int p_230962_1_)
int
getRowWidth()
double
getScrollAmount()
protected int
getScrollbarPosition()
E
getSelected()
int
getTop()
int
getWidth()
protected boolean
isFocused()
boolean
isMouseOver(double p_231047_1_, double p_231047_3_)
protected boolean
isSelectedItem(int p_230957_1_)
boolean
keyPressed(int p_231046_1_, int p_231046_2_, int p_231046_3_)
boolean
mouseClicked(double p_231044_1_, double p_231044_3_, int p_231044_5_)
boolean
mouseDragged(double p_231045_1_, double p_231045_3_, int p_231045_5_, double p_231045_6_, double p_231045_8_)
boolean
mouseReleased(double p_231048_1_, double p_231048_3_, int p_231048_5_)
boolean
mouseScrolled(double p_231043_1_, double p_231043_3_, double p_231043_5_)
protected void
moveSelection(AbstractList.Ordering p_241219_1_)
protected void
moveSelection(AbstractList.Ordering p_241572_1_, java.util.function.Predicate<E> p_241572_2_)
protected void
refreshSelection()
protected E
remove(int p_230964_1_)
protected boolean
removeEntry(E p_230956_1_)
void
render(MatrixStack p_230430_1_, int p_230430_2_, int p_230430_3_, float p_230430_4_)
protected void
renderBackground(MatrixStack p_230433_1_)
protected void
renderDecorations(MatrixStack p_230447_1_, int p_230447_2_, int p_230447_3_)
protected void
renderHeader(MatrixStack p_230448_1_, int p_230448_2_, int p_230448_3_, Tessellator p_230448_4_)
protected void
renderList(MatrixStack p_238478_1_, int p_238478_2_, int p_238478_3_, int p_238478_4_, int p_238478_5_, float p_238478_6_)
protected void
replaceEntries(java.util.Collection<E> p_230942_1_)
private void
scroll(int p_230937_1_)
void
setLeftPos(int p_230959_1_)
void
setRenderBackground(boolean p_244605_1_)
protected void
setRenderHeader(boolean p_230944_1_, int p_230944_2_)
void
setRenderSelection(boolean p_230943_1_)
void
setRenderTopAndBottom(boolean p_244606_1_)
void
setScrollAmount(double p_230932_1_)
void
setSelected(E p_241215_1_)
protected void
updateScrollingState(double p_230947_1_, double p_230947_3_, int p_230947_5_)
void
updateSize(int p_230940_1_, int p_230940_2_, int p_230940_3_, int p_230940_4_)
-
Methods inherited from class net.minecraft.client.gui.FocusableGui
isDragging, setDragging, setFocused
-
Methods inherited from class net.minecraft.client.gui.AbstractGui
blit, blit, blit, blit, blit, blitOutlineBlack, drawCenteredString, drawCenteredString, drawString, drawString, fill, fillGradient, fillGradient, getBlitOffset, hLine, setBlitOffset, vLine
-
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.IGuiEventListener
mouseMoved
-
Methods inherited from interface net.minecraft.client.gui.INestedGuiEventHandler
changeFocus, charTyped, getChildAt, keyReleased, magicalSpecialHackyFocus, setInitialFocus
-
-
-
-
Field Detail
-
minecraft
protected final Minecraft minecraft
-
itemHeight
protected final int itemHeight
-
children
private final java.util.List<E extends AbstractList.AbstractListEntry<E>> children
-
width
protected int width
-
height
protected int height
-
y0
protected int y0
-
y1
protected int y1
-
x1
protected int x1
-
x0
protected int x0
-
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
private E extends AbstractList.AbstractListEntry<E> selected
-
renderBackground
private boolean renderBackground
-
renderTopAndBottom
private boolean renderTopAndBottom
-
-
Constructor Detail
-
AbstractList
public AbstractList(Minecraft p_i51146_1_, int p_i51146_2_, int p_i51146_3_, int p_i51146_4_, int p_i51146_5_, int p_i51146_6_)
-
-
Method Detail
-
setRenderSelection
public void setRenderSelection(boolean p_230943_1_)
-
setRenderHeader
protected void setRenderHeader(boolean p_230944_1_, int p_230944_2_)
-
getRowWidth
public int getRowWidth()
-
getSelected
@Nullable public E getSelected()
-
setSelected
public void setSelected(@Nullable E p_241215_1_)
-
setRenderBackground
public void setRenderBackground(boolean p_244605_1_)
-
setRenderTopAndBottom
public void setRenderTopAndBottom(boolean p_244606_1_)
-
getFocused
@Nullable public E getFocused()
- Specified by:
getFocused
in interfaceINestedGuiEventHandler
- Overrides:
getFocused
in classFocusableGui
-
children
public final java.util.List<E> children()
- Specified by:
children
in interfaceINestedGuiEventHandler
-
clearEntries
protected final void clearEntries()
-
replaceEntries
protected void replaceEntries(java.util.Collection<E> p_230942_1_)
-
getEntry
protected E getEntry(int p_230953_1_)
-
addEntry
protected int addEntry(E p_230513_1_)
-
getItemCount
protected int getItemCount()
-
isSelectedItem
protected boolean isSelectedItem(int p_230957_1_)
-
getEntryAtPosition
@Nullable protected final E getEntryAtPosition(double p_230933_1_, double p_230933_3_)
-
updateSize
public void updateSize(int p_230940_1_, int p_230940_2_, int p_230940_3_, int p_230940_4_)
-
setLeftPos
public void setLeftPos(int p_230959_1_)
-
getMaxPosition
protected int getMaxPosition()
-
clickedHeader
protected void clickedHeader(int p_230938_1_, int p_230938_2_)
-
renderHeader
protected void renderHeader(MatrixStack p_230448_1_, int p_230448_2_, int p_230448_3_, Tessellator p_230448_4_)
-
renderBackground
protected void renderBackground(MatrixStack p_230433_1_)
-
renderDecorations
protected void renderDecorations(MatrixStack p_230447_1_, int p_230447_2_, int p_230447_3_)
-
render
public void render(MatrixStack p_230430_1_, int p_230430_2_, int p_230430_3_, float p_230430_4_)
- Specified by:
render
in interfaceIRenderable
-
centerScrollOn
protected void centerScrollOn(E p_230951_1_)
-
ensureVisible
protected void ensureVisible(E p_230954_1_)
-
scroll
private void scroll(int p_230937_1_)
-
getScrollAmount
public double getScrollAmount()
-
setScrollAmount
public void setScrollAmount(double p_230932_1_)
-
getMaxScroll
public int getMaxScroll()
-
updateScrollingState
protected void updateScrollingState(double p_230947_1_, double p_230947_3_, int p_230947_5_)
-
getScrollbarPosition
protected int getScrollbarPosition()
-
mouseClicked
public boolean mouseClicked(double p_231044_1_, double p_231044_3_, int p_231044_5_)
- Specified by:
mouseClicked
in interfaceIGuiEventListener
- Specified by:
mouseClicked
in interfaceINestedGuiEventHandler
-
mouseReleased
public boolean mouseReleased(double p_231048_1_, double p_231048_3_, int p_231048_5_)
- Specified by:
mouseReleased
in interfaceIGuiEventListener
- Specified by:
mouseReleased
in interfaceINestedGuiEventHandler
-
mouseDragged
public boolean mouseDragged(double p_231045_1_, double p_231045_3_, int p_231045_5_, double p_231045_6_, double p_231045_8_)
- Specified by:
mouseDragged
in interfaceIGuiEventListener
- Specified by:
mouseDragged
in interfaceINestedGuiEventHandler
-
mouseScrolled
public boolean mouseScrolled(double p_231043_1_, double p_231043_3_, double p_231043_5_)
- Specified by:
mouseScrolled
in interfaceIGuiEventListener
- Specified by:
mouseScrolled
in interfaceINestedGuiEventHandler
-
keyPressed
public boolean keyPressed(int p_231046_1_, int p_231046_2_, int p_231046_3_)
- Specified by:
keyPressed
in interfaceIGuiEventListener
- Specified by:
keyPressed
in interfaceINestedGuiEventHandler
-
moveSelection
protected void moveSelection(AbstractList.Ordering p_241219_1_)
-
refreshSelection
protected void refreshSelection()
-
moveSelection
protected void moveSelection(AbstractList.Ordering p_241572_1_, java.util.function.Predicate<E> p_241572_2_)
-
isMouseOver
public boolean isMouseOver(double p_231047_1_, double p_231047_3_)
- Specified by:
isMouseOver
in interfaceIGuiEventListener
-
renderList
protected void renderList(MatrixStack p_238478_1_, int p_238478_2_, int p_238478_3_, int p_238478_4_, int p_238478_5_, float p_238478_6_)
-
getRowLeft
public int getRowLeft()
-
getRowRight
public int getRowRight()
-
getRowTop
protected int getRowTop(int p_230962_1_)
-
getRowBottom
private int getRowBottom(int p_230948_1_)
-
isFocused
protected boolean isFocused()
-
remove
protected E remove(int p_230964_1_)
-
removeEntry
protected boolean removeEntry(E p_230956_1_)
-
bindEntryToSelf
private void bindEntryToSelf(AbstractList.AbstractListEntry<E> p_238480_1_)
-
getWidth
public int getWidth()
-
getHeight
public int getHeight()
-
getTop
public int getTop()
-
getBottom
public int getBottom()
-
getLeft
public int getLeft()
-
getRight
public int getRight()
-
-