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, or that of the servers connected directly. The information for directly-connected servers are also saved (although hidden from the multiplayer screen) so that chat preview acknowledgements and other settings are saved. The list of these servers is stored in the servers.dat file within the client game directory.
See Also:
Mappings:
Namespace Name
official evb
intermediary net/minecraft/class_642
named net/minecraft/client/network/ServerInfo
  • Field Details

    • LOGGER

      private static final Logger LOGGER
      Mappings:
      Namespace Name Mixin selector
      official j Levb;j:Lorg/slf4j/Logger;
      intermediary field_39355 Lnet/minecraft/class_642;field_39355:Lorg/slf4j/Logger;
      named LOGGER Lnet/minecraft/client/network/ServerInfo;LOGGER:Lorg/slf4j/Logger;
    • name

      public String name
      Mappings:
      Namespace Name Mixin selector
      official a Levb;a:Ljava/lang/String;
      intermediary field_3752 Lnet/minecraft/class_642;field_3752:Ljava/lang/String;
      named name Lnet/minecraft/client/network/ServerInfo;name:Ljava/lang/String;
    • address

      public String address
      Mappings:
      Namespace Name Mixin selector
      official b Levb;b:Ljava/lang/String;
      intermediary field_3761 Lnet/minecraft/class_642;field_3761:Ljava/lang/String;
      named address Lnet/minecraft/client/network/ServerInfo;address:Ljava/lang/String;
    • playerCountLabel

      public Text playerCountLabel
      Mappings:
      Namespace Name Mixin selector
      official c Levb;c:Lrq;
      intermediary field_3753 Lnet/minecraft/class_642;field_3753:Lnet/minecraft/class_2561;
      named playerCountLabel Lnet/minecraft/client/network/ServerInfo;playerCountLabel:Lnet/minecraft/text/Text;
    • label

      public Text label
      Mappings:
      Namespace Name Mixin selector
      official d Levb;d:Lrq;
      intermediary field_3757 Lnet/minecraft/class_642;field_3757:Lnet/minecraft/class_2561;
      named label Lnet/minecraft/client/network/ServerInfo;label:Lnet/minecraft/text/Text;
    • ping

      public long ping
      Mappings:
      Namespace Name Mixin selector
      official e Levb;e:J
      intermediary field_3758 Lnet/minecraft/class_642;field_3758:J
      named ping Lnet/minecraft/client/network/ServerInfo;ping:J
    • protocolVersion

      public int protocolVersion
      Mappings:
      Namespace Name Mixin selector
      official f Levb;f:I
      intermediary field_3756 Lnet/minecraft/class_642;field_3756:I
      named protocolVersion Lnet/minecraft/client/network/ServerInfo;protocolVersion:I
    • version

      public Text version
      Mappings:
      Namespace Name Mixin selector
      official g Levb;g:Lrq;
      intermediary field_3760 Lnet/minecraft/class_642;field_3760:Lnet/minecraft/class_2561;
      named version Lnet/minecraft/client/network/ServerInfo;version:Lnet/minecraft/text/Text;
    • online

      public boolean online
      Mappings:
      Namespace Name Mixin selector
      official h Levb;h:Z
      intermediary field_3754 Lnet/minecraft/class_642;field_3754:Z
      named online Lnet/minecraft/client/network/ServerInfo;online:Z
    • playerListSummary

      public List<Text> playerListSummary
      Mappings:
      Namespace Name Mixin selector
      official i Levb;i:Ljava/util/List;
      intermediary field_3762 Lnet/minecraft/class_642;field_3762:Ljava/util/List;
      named playerListSummary Lnet/minecraft/client/network/ServerInfo;playerListSummary:Ljava/util/List;
    • resourcePackPolicy

      private ServerInfo.ResourcePackPolicy resourcePackPolicy
      Mappings:
      Namespace Name Mixin selector
      official k Levb;k:Levb$b;
      intermediary field_3755 Lnet/minecraft/class_642;field_3755:Lnet/minecraft/class_642$class_643;
      named resourcePackPolicy Lnet/minecraft/client/network/ServerInfo;resourcePackPolicy:Lnet/minecraft/client/network/ServerInfo$ResourcePackPolicy;
    • icon

      @Nullable private @Nullable String icon
      Mappings:
      Namespace Name Mixin selector
      official l Levb;l:Ljava/lang/String;
      intermediary field_3759 Lnet/minecraft/class_642;field_3759:Ljava/lang/String;
      named icon Lnet/minecraft/client/network/ServerInfo;icon:Ljava/lang/String;
    • local

      private boolean local
      Mappings:
      Namespace Name Mixin selector
      official m Levb;m:Z
      intermediary field_3763 Lnet/minecraft/class_642;field_3763:Z
      named local Lnet/minecraft/client/network/ServerInfo;local:Z
    • chatPreview

      Mappings:
      Namespace Name Mixin selector
      official n Levb;n:Levb$a;
      intermediary field_39356 Lnet/minecraft/class_642;field_39356:Lnet/minecraft/class_642$class_7484;
      named chatPreview Lnet/minecraft/client/network/ServerInfo;chatPreview:Lnet/minecraft/client/network/ServerInfo$ChatPreview;
    • temporaryChatPreviewState

      private boolean temporaryChatPreviewState
      Mappings:
      Namespace Name Mixin selector
      official o Levb;o:Z
      intermediary field_39436 Lnet/minecraft/class_642;field_39436:Z
      named temporaryChatPreviewState Lnet/minecraft/client/network/ServerInfo;temporaryChatPreviewState:Z
    • secureChatEnforced

      private boolean secureChatEnforced
      Mappings:
      Namespace Name Mixin selector
      official p Levb;p:Z
      intermediary field_39918 Lnet/minecraft/class_642;field_39918:Z
      named secureChatEnforced Lnet/minecraft/client/network/ServerInfo;secureChatEnforced:Z
  • Constructor Details

    • ServerInfo

      public ServerInfo(String name, String address, boolean local)
      Mappings:
      Namespace Name Mixin selector
      official <init> Levb;<init>(Ljava/lang/String;Ljava/lang/String;Z)V
      intermediary <init> Lnet/minecraft/class_642;<init>(Ljava/lang/String;Ljava/lang/String;Z)V
      named <init> Lnet/minecraft/client/network/ServerInfo;<init>(Ljava/lang/String;Ljava/lang/String;Z)V
  • Method Details

    • toNbt

      public NbtCompound toNbt()
      Mappings:
      Namespace Name Mixin selector
      official a Levb;a()Lpj;
      intermediary method_2992 Lnet/minecraft/class_642;method_2992()Lnet/minecraft/class_2487;
      named toNbt Lnet/minecraft/client/network/ServerInfo;toNbt()Lnet/minecraft/nbt/NbtCompound;
    • getResourcePackPolicy

      public ServerInfo.ResourcePackPolicy getResourcePackPolicy()
      Returns the policy on resource packs sent by this server.
      Returns:
      the policy on resource packs sent by this server
      Mappings:
      Namespace Name Mixin selector
      official b Levb;b()Levb$b;
      intermediary method_2990 Lnet/minecraft/class_642;method_2990()Lnet/minecraft/class_642$class_643;
      named getResourcePackPolicy Lnet/minecraft/client/network/ServerInfo;getResourcePackPolicy()Lnet/minecraft/client/network/ServerInfo$ResourcePackPolicy;
    • setResourcePackPolicy

      public void setResourcePackPolicy(ServerInfo.ResourcePackPolicy resourcePackPolicy)
      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.

      Mappings:
      Namespace Name Mixin selector
      official a Levb;a(Levb$b;)V
      intermediary method_2995 Lnet/minecraft/class_642;method_2995(Lnet/minecraft/class_642$class_643;)V
      named setResourcePackPolicy Lnet/minecraft/client/network/ServerInfo;setResourcePackPolicy(Lnet/minecraft/client/network/ServerInfo$ResourcePackPolicy;)V
    • fromNbt

      public static ServerInfo fromNbt(NbtCompound root)
      Mappings:
      Namespace Name Mixin selector
      official a Levb;a(Lpj;)Levb;
      intermediary method_2993 Lnet/minecraft/class_642;method_2993(Lnet/minecraft/class_2487;)Lnet/minecraft/class_642;
      named fromNbt Lnet/minecraft/client/network/ServerInfo;fromNbt(Lnet/minecraft/nbt/NbtCompound;)Lnet/minecraft/client/network/ServerInfo;
    • getIcon

      @Nullable public @Nullable String getIcon()
      Mappings:
      Namespace Name Mixin selector
      official c Levb;c()Ljava/lang/String;
      intermediary method_2991 Lnet/minecraft/class_642;method_2991()Ljava/lang/String;
      named getIcon Lnet/minecraft/client/network/ServerInfo;getIcon()Ljava/lang/String;
    • parseFavicon

      public static String parseFavicon(String favicon) throws ParseException
      Throws:
      ParseException
      Mappings:
      Namespace Name Mixin selector
      official a Levb;a(Ljava/lang/String;)Ljava/lang/String;
      intermediary method_44078 Lnet/minecraft/class_642;method_44078(Ljava/lang/String;)Ljava/lang/String;
      named parseFavicon Lnet/minecraft/client/network/ServerInfo;parseFavicon(Ljava/lang/String;)Ljava/lang/String;
    • setIcon

      public void setIcon(@Nullable @Nullable String icon)
      Mappings:
      Namespace Name Mixin selector
      official b Levb;b(Ljava/lang/String;)V
      intermediary method_2989 Lnet/minecraft/class_642;method_2989(Ljava/lang/String;)V
      named setIcon Lnet/minecraft/client/network/ServerInfo;setIcon(Ljava/lang/String;)V
    • isLocal

      public boolean isLocal()
      Mappings:
      Namespace Name Mixin selector
      official d Levb;d()Z
      intermediary method_2994 Lnet/minecraft/class_642;method_2994()Z
      named isLocal Lnet/minecraft/client/network/ServerInfo;isLocal()Z
    • setPreviewsChat

      public void setPreviewsChat(boolean enabled)
      Sets whether the chat preview is enabled. This affects the saved server info; to disable the chat preview temporarily use setTemporaryChatPreviewState(boolean).
      Mappings:
      Namespace Name Mixin selector
      official a Levb;a(Z)V
      intermediary method_44080 Lnet/minecraft/class_642;method_44080(Z)V
      named setPreviewsChat Lnet/minecraft/client/network/ServerInfo;setPreviewsChat(Z)V
    • getChatPreview

      @Nullable public @Nullable ServerInfo.ChatPreview getChatPreview()
      Mappings:
      Namespace Name Mixin selector
      official e Levb;e()Levb$a;
      intermediary method_44081 Lnet/minecraft/class_642;method_44081()Lnet/minecraft/class_642$class_7484;
      named getChatPreview Lnet/minecraft/client/network/ServerInfo;getChatPreview()Lnet/minecraft/client/network/ServerInfo$ChatPreview;
    • setTemporaryChatPreviewState

      public void setTemporaryChatPreviewState(boolean temporaryChatPreviewState)
      Sets the temporary chat preview state. Unlike setPreviewsChat(boolean), this does not affect the saved server info.
      Mappings:
      Namespace Name Mixin selector
      official b Levb;b(Z)V
      intermediary method_44293 Lnet/minecraft/class_642;method_44293(Z)V
      named setTemporaryChatPreviewState Lnet/minecraft/client/network/ServerInfo;setTemporaryChatPreviewState(Z)V
    • shouldPreviewChat

      public boolean shouldPreviewChat()
      Mappings:
      Namespace Name Mixin selector
      official f Levb;f()Z
      intermediary method_44082 Lnet/minecraft/class_642;method_44082()Z
      named shouldPreviewChat Lnet/minecraft/client/network/ServerInfo;shouldPreviewChat()Z
    • setSecureChatEnforced

      public void setSecureChatEnforced(boolean secureChatEnforced)
      Mappings:
      Namespace Name Mixin selector
      official c Levb;c(Z)V
      intermediary method_45055 Lnet/minecraft/class_642;method_45055(Z)V
      named setSecureChatEnforced Lnet/minecraft/client/network/ServerInfo;setSecureChatEnforced(Z)V
    • isSecureChatEnforced

      public boolean isSecureChatEnforced()
      Mappings:
      Namespace Name Mixin selector
      official g Levb;g()Z
      intermediary method_45056 Lnet/minecraft/class_642;method_45056()Z
      named isSecureChatEnforced Lnet/minecraft/client/network/ServerInfo;isSecureChatEnforced()Z
    • copyFrom

      public void copyFrom(ServerInfo serverInfo)
      Mappings:
      Namespace Name Mixin selector
      official a Levb;a(Levb;)V
      intermediary method_44292 Lnet/minecraft/class_642;method_44292(Lnet/minecraft/class_642;)V
      named copyFrom Lnet/minecraft/client/network/ServerInfo;copyFrom(Lnet/minecraft/client/network/ServerInfo;)V
    • copyWithSettingsFrom

      public void copyWithSettingsFrom(ServerInfo serverInfo)
      Mappings:
      Namespace Name Mixin selector
      official b Levb;b(Levb;)V
      intermediary method_2996 Lnet/minecraft/class_642;method_2996(Lnet/minecraft/class_642;)V
      named copyWithSettingsFrom Lnet/minecraft/client/network/ServerInfo;copyWithSettingsFrom(Lnet/minecraft/client/network/ServerInfo;)V