Class MultiplayerServerListWidget
java.lang.Object
net.minecraft.client.gui.DrawableHelper
net.minecraft.client.gui.AbstractParentElement
net.minecraft.client.gui.widget.EntryListWidget<E>
net.minecraft.client.gui.widget.AlwaysSelectedEntryListWidget<MultiplayerServerListWidget.Entry>
net.minecraft.client.gui.screen.multiplayer.MultiplayerServerListWidget
- All Implemented Interfaces:
Drawable,Element,ParentElement
@Environment(CLIENT) public class MultiplayerServerListWidget extends AlwaysSelectedEntryListWidget<MultiplayerServerListWidget.Entry>
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classMultiplayerServerListWidget.Entrystatic classMultiplayerServerListWidget.LanServerEntrystatic classMultiplayerServerListWidget.ScanningEntryclassMultiplayerServerListWidget.ServerEntryNested classes/interfaces inherited from class net.minecraft.client.gui.widget.EntryListWidget
EntryListWidget.MoveDirection -
Field Summary
Fields Modifier and Type Field Description private static TextCANNOT_CONNECT_TEXTprivate static TextCANNOT_RESOLVE_TEXTprivate static TextINCOMPATIBLE_TEXTprivate static TextLAN_SCANNING_TEXTprivate List<MultiplayerServerListWidget.LanServerEntry>lanServersprivate static LoggerLOGGERprivate static TextNO_CONNECTION_TEXTprivate static TextPINGING_TEXTprivate MultiplayerServerListWidget.EntryscanningEntryprivate MultiplayerScreenscreenprivate static ThreadPoolExecutorSERVER_PINGER_THREAD_POOLprivate static IdentifierSERVER_SELECTION_TEXTUREprivate List<MultiplayerServerListWidget.ServerEntry>serversprivate static IdentifierUNKNOWN_SERVER_TEXTUREFields inherited from class net.minecraft.client.gui.widget.EntryListWidget
bottom, centerListVertically, client, headerHeight, height, itemHeight, left, right, top, widthFields inherited from class net.minecraft.client.gui.DrawableHelper
GUI_ICONS_TEXTURE, OPTIONS_BACKGROUND_TEXTURE, STATS_ICON_TEXTURE -
Constructor Summary
Constructors Constructor Description MultiplayerServerListWidget(MultiplayerScreen screen, MinecraftClient client, int width, int height, int top, int bottom, int entryHeight) -
Method Summary
Modifier and Type Method Description intgetRowWidth()protected intgetScrollbarPositionX()protected booleanisFocused()booleankeyPressed(int keyCode, int scanCode, int modifiers)Callback for when a key down event has been captured.protected voidmoveSelection(EntryListWidget.MoveDirection direction)voidsetLanServers(List<LanServerInfo> lanServers)voidsetSelected(MultiplayerServerListWidget.Entry entry)voidsetServers(ServerList servers)private voidupdateEntries()Methods inherited from class net.minecraft.client.gui.widget.AlwaysSelectedEntryListWidget
changeFocusMethods inherited from class net.minecraft.client.gui.widget.EntryListWidget
addEntry, centerScrollOn, children, clearEntries, clickedHeader, ensureVisible, getEntry, getEntryAtPosition, getFocused, getItemCount, getMaxPosition, getMaxScroll, getRowLeft, getRowTop, getScrollAmount, getSelected, isMouseOver, isSelectedItem, method_30015, method_31322, method_31323, method_31383, mouseClicked, mouseDragged, mouseReleased, mouseScrolled, moveSelectionIf, remove, removeEntry, render, renderBackground, renderDecorations, renderHeader, renderList, replaceEntries, setLeftPos, setRenderHeader, setRenderSelection, setScrollAmount, updateScrollingState, updateSizeMethods 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, method_33284, 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.Element
mouseMovedMethods inherited from interface net.minecraft.client.gui.ParentElement
charTyped, focusOn, hoveredElement, keyReleased, setInitialFocus
-
Field Details
-
LOGGER
-
SERVER_PINGER_THREAD_POOL
-
UNKNOWN_SERVER_TEXTURE
-
SERVER_SELECTION_TEXTURE
-
LAN_SCANNING_TEXT
-
CANNOT_RESOLVE_TEXT
-
CANNOT_CONNECT_TEXT
-
INCOMPATIBLE_TEXT
-
NO_CONNECTION_TEXT
-
PINGING_TEXT
-
screen
-
servers
-
scanningEntry
-
lanServers
-
-
Constructor Details
-
MultiplayerServerListWidget
public MultiplayerServerListWidget(MultiplayerScreen screen, MinecraftClient client, int width, int height, int top, int bottom, int entryHeight)
-
-
Method Details
-
updateEntries
private void updateEntries() -
setSelected
- Overrides:
setSelectedin classEntryListWidget<MultiplayerServerListWidget.Entry>
-
keyPressed
public boolean keyPressed(int keyCode, int scanCode, int modifiers)Callback for when a key down event has been captured. The key code is identified by the constants inGLFWclass.- Specified by:
keyPressedin interfaceElement- Specified by:
keyPressedin interfaceParentElement- Overrides:
keyPressedin classEntryListWidget<MultiplayerServerListWidget.Entry>- Parameters:
keyCode- the named key code of the event as described in theGLFWclassscanCode- the unique/platform-specific scan code of the keyboard inputmodifiers- a GLFW bitfield describing the modifier keys that are held down (see GLFW Modifier key flags)- Returns:
trueto indicate that the event handling is successful/valid- See Also:
Keyboard.onKey(long, int, int, int, int),GLFW.GLFW_KEY_Q,GLFWKeyCallbackI.invoke(long, int, int, int, int)
-
moveSelection
- Overrides:
moveSelectionin classEntryListWidget<MultiplayerServerListWidget.Entry>
-
setServers
-
setLanServers
-
getScrollbarPositionX
protected int getScrollbarPositionX()- Overrides:
getScrollbarPositionXin classEntryListWidget<MultiplayerServerListWidget.Entry>
-
getRowWidth
public int getRowWidth()- Overrides:
getRowWidthin classEntryListWidget<MultiplayerServerListWidget.Entry>
-
isFocused
protected boolean isFocused()- Overrides:
isFocusedin classEntryListWidget<MultiplayerServerListWidget.Entry>
-