Package net.minecraft.client.network
Class ServerInfo
java.lang.Object
net.minecraft.client.network.ServerInfo
@Environment(CLIENT) public class ServerInfo extends Object
The information of a server entry in the list of servers available in
the multiplayer screen from the menu. The list of these servers is
stored in the
servers.dat file within the client game directory.-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classServerInfo.ResourcePackState -
Field Summary
Fields Modifier and Type Field Description Stringaddressprivate StringiconTextlabelprivate booleanlocalStringnamebooleanonlinelongpingTextplayerCountLabelList<Text>playerListSummaryintprotocolVersionprivate ServerInfo.ResourcePackStateresourcePackPolicyTextversion -
Constructor Summary
Constructors Constructor Description ServerInfo(String name, String address, boolean local) -
Method Summary
Modifier and Type Method Description voidcopyFrom(ServerInfo serverInfo)static ServerInfofromNbt(NbtCompound root)StringgetIcon()ServerInfo.ResourcePackStategetResourcePackPolicy()Returns the policy on resource packs sent by this server.booleanisLocal()voidsetIcon(String icon)voidsetResourcePackPolicy(ServerInfo.ResourcePackState policy)Sets the resource pack policy on this server.NbtCompoundtoNbt()
-
Field Details
-
name
-
address
-
playerCountLabel
-
label
-
ping
public long ping -
protocolVersion
public int protocolVersion -
version
-
online
public boolean online -
playerListSummary
-
resourcePackPolicy
-
icon
-
local
private boolean local
-
-
Constructor Details
-
ServerInfo
-
-
Method Details
-
toNbt
-
getResourcePackPolicy
Returns the policy on resource packs sent by this server. -
setResourcePackPolicy
Sets the resource pack policy on this server.This is called when a user has responded to the prompt on whether to accept server resource packs from this server in the future.
-
fromNbt
-
getIcon
-
setIcon
-
isLocal
public boolean isLocal() -
copyFrom
-