Class ServerSelectionList.OnlineServerEntry
java.lang.Object
net.minecraft.client.gui.components.AbstractSelectionList.Entry<ServerSelectionList.Entry>
net.minecraft.client.gui.components.ObjectSelectionList.Entry<ServerSelectionList.Entry>
net.minecraft.client.gui.screens.multiplayer.ServerSelectionList.Entry
net.minecraft.client.gui.screens.multiplayer.ServerSelectionList.OnlineServerEntry
- All Implemented Interfaces:
AutoCloseable
,GuiEventListener
,TabOrderedElement
,NarrationSupplier
- Enclosing class:
ServerSelectionList
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final FaviconTexture
private static final int
private static final int
private long
private byte[]
private final Minecraft
private final JoinMultiplayerScreen
private final ServerData
private static final int
private static final int
private static final int
private ResourceLocation
private Component
Fields inherited from class net.minecraft.client.gui.components.AbstractSelectionList.Entry
list
Fields inherited from interface net.minecraft.client.gui.components.events.GuiEventListener
DOUBLE_CLICK_THRESHOLD_MS
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
OnlineServerEntry
(JoinMultiplayerScreen screen, ServerData serverData) -
Method Summary
Modifier and TypeMethodDescriptionprivate boolean
canJoin()
void
close()
protected void
drawIcon
(GuiGraphics guiGraphics, int x, int y, ResourceLocation icon) boolean
keyPressed
(int keyCode, int scanCode, int modifiers) Called when a keyboard key is pressed within the GUI element.boolean
mouseClicked
(double mouseX, double mouseY, int button) Called when a mouse button is clicked within the GUI element.private void
void
render
(GuiGraphics guiGraphics, int index, int top, int left, int width, int height, int mouseX, int mouseY, boolean hovering, float partialTick) private void
swap
(int pos1, int pos2) void
private boolean
uploadServerIcon
(byte[] iconBytes) Methods inherited from class net.minecraft.client.gui.components.ObjectSelectionList.Entry
updateNarration
Methods inherited from class net.minecraft.client.gui.components.AbstractSelectionList.Entry
isFocused, isMouseOver, renderBack, setFocused
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.GuiEventListener
charTyped, getCurrentFocusPath, getRectangle, keyReleased, mouseDragged, mouseMoved, mouseReleased, mouseScrolled, nextFocusPath
Methods inherited from interface net.minecraft.client.gui.components.TabOrderedElement
getTabOrderGroup
-
Field Details
-
ICON_WIDTH
private static final int ICON_WIDTH- See Also:
-
ICON_HEIGHT
private static final int ICON_HEIGHT- See Also:
-
SPACING
private static final int SPACING- See Also:
-
STATUS_ICON_WIDTH
private static final int STATUS_ICON_WIDTH- See Also:
-
STATUS_ICON_HEIGHT
private static final int STATUS_ICON_HEIGHT- See Also:
-
screen
-
minecraft
-
serverData
-
icon
-
lastIconBytes
@Nullable private byte[] lastIconBytes -
lastClickTime
private long lastClickTime -
onlinePlayersTooltip
-
statusIcon
-
statusIconTooltip
-
-
Constructor Details
-
OnlineServerEntry
-
-
Method Details
-
render
public void render(GuiGraphics guiGraphics, int index, int top, int left, int width, int height, int mouseX, int mouseY, boolean hovering, float partialTick) - Specified by:
render
in classAbstractSelectionList.Entry<ServerSelectionList.Entry>
-
refreshStatus
private void refreshStatus() -
updateServerList
public void updateServerList() -
drawIcon
-
canJoin
private boolean canJoin() -
uploadServerIcon
private boolean uploadServerIcon(@Nullable byte[] iconBytes) -
keyPressed
public boolean keyPressed(int keyCode, int scanCode, int modifiers) Called when a keyboard key is pressed within the GUI element.- Parameters:
keyCode
- the key code of the pressed key.scanCode
- the scan code of the pressed key.modifiers
- the keyboard modifiers.- Returns:
true
if the event is consumed,false
otherwise.
-
swap
private void swap(int pos1, int pos2) -
mouseClicked
public boolean mouseClicked(double mouseX, double mouseY, int button) Called when a mouse button is clicked within the GUI element.- Specified by:
mouseClicked
in interfaceGuiEventListener
- Overrides:
mouseClicked
in classObjectSelectionList.Entry<ServerSelectionList.Entry>
- Parameters:
mouseX
- the X coordinate of the mouse.mouseY
- the Y coordinate of the mouse.button
- the button that was clicked.- Returns:
true
if the event is consumed,false
otherwise.
-
getServerData
-
getNarration
- Specified by:
getNarration
in classObjectSelectionList.Entry<ServerSelectionList.Entry>
-
close
public void close()- Specified by:
close
in interfaceAutoCloseable
- Overrides:
close
in classServerSelectionList.Entry
-