Record Class ServerStatusPing
 {
     "fmlNetworkVersion" : FMLNETVERSION,
     "channels": [
          {
              "res": "fml:handshake",
              "version": "1.2.3.4",
              "required": true
          }
     ],
     "mods": [
          {
              "modid": "modid",
              "modmarker": "{@literal <somestring>}"
          }
     ]
 }
 Due to size of the ping packet (32767 UTF-16 code points of JSON data) this could exceed this limit and cause issues. To work around this, a truncation mechanism was introduced, to heuristically truncate the size of the data, at the expense of making the compatibility info on the server screen inaccurate.
 Modern versions will send binary data, which is encoded in a custom format optimized for UTF-16 code point count.
 See encodeOptimized(ByteBuf) and decodeOptimized(String).
 Essentially 15 bits of binary data are encoded into every UTF-16 code point. The resulting string is then stored in
 the "d" property of the resulting JSON.
 
The "channels" and "mods" properties are retained for backwards compatibility, but left empty. A client that cannot read the old format would not be able to connect anyways, but the properties must exist to not cause exceptions.
 {
     "fmlNetworkVersion": FMLNETVERSION,
     "channels": [],
     "mods": [],
     "d": "<binary data>"
 }
 - 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionstatic final recordstatic final record
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprivate static final com.mojang.serialization.Codec<io.netty.buffer.ByteBuf>private final Map<ResourceLocation,ServerStatusPing.ChannelData> The field for thechannelsrecord component.static final com.mojang.serialization.Codec<ServerStatusPing>private final intThe field for thefmlNetworkVerrecord component.The field for themodsrecord component.private final booleanThe field for thetruncatedrecord component.private static final int
- 
Constructor SummaryConstructorsConstructorDescriptionServerStatusPing(Map<ResourceLocation, ServerStatusPing.ChannelData> channels, Map<String, String> mods, int fmlNetworkVer, boolean truncated) Creates an instance of aServerStatusPingrecord class.
- 
Method SummaryModifier and TypeMethodDescriptionchannels()Returns the value of thechannelsrecord component.private static io.netty.buffer.ByteBufDecode binary data encoded byencodeOptimized(io.netty.buffer.ByteBuf)private static ServerStatusPingdeserializeOptimized(int fmlNetworkVersion, io.netty.buffer.ByteBuf bbuf) private static StringencodeOptimized(io.netty.buffer.ByteBuf buf) Encode given ByteBuf to a String.booleanIndicates whether some other object is "equal to" this one.intReturns the value of thefmlNetworkVerrecord component.getChannelsForMod(String modId) intinthashCode()Returns a hash code value for this object.booleanmods()Returns the value of themodsrecord component.io.netty.buffer.ByteBuftoBuf()final StringtoString()Returns a string representation of this record class.booleanReturns the value of thetruncatedrecord component.
- 
Field Details- 
channelsThe field for thechannelsrecord component.
- 
modsThe field for themodsrecord component.
- 
fmlNetworkVerprivate final int fmlNetworkVerThe field for thefmlNetworkVerrecord component.
- 
truncatedprivate final boolean truncatedThe field for thetruncatedrecord component.
- 
BYTE_BUF_CODECprivate static final com.mojang.serialization.Codec<io.netty.buffer.ByteBuf> BYTE_BUF_CODEC
- 
CODEC
- 
VERSION_FLAG_IGNORESERVERONLYprivate static final int VERSION_FLAG_IGNORESERVERONLY- See Also:
 
 
- 
- 
Constructor Details- 
ServerStatusPingpublic ServerStatusPing()
- 
ServerStatusPingpublic ServerStatusPing(Map<ResourceLocation, ServerStatusPing.ChannelData> channels, Map<String, String> mods, int fmlNetworkVer, boolean truncated) Creates an instance of aServerStatusPingrecord class.- Parameters:
- channels- the value for the- channelsrecord component
- mods- the value for the- modsrecord component
- fmlNetworkVer- the value for the- fmlNetworkVerrecord component
- truncated- the value for the- truncatedrecord component
 
 
- 
- 
Method Details- 
equalsIndicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='.
- 
hashCodepublic int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
- 
getChannelsForModprivate List<Map.Entry<ResourceLocation,ServerStatusPing.ChannelData>> getChannelsForMod(String modId) 
- 
getNonModChannels
- 
toBufpublic io.netty.buffer.ByteBuf toBuf()
- 
deserializeOptimizedprivate static ServerStatusPing deserializeOptimized(int fmlNetworkVersion, io.netty.buffer.ByteBuf bbuf) 
- 
encodeOptimizedEncode given ByteBuf to a String. This is optimized for UTF-16 Code-Point count. Supports at most 2^30 bytes in length
- 
decodeOptimizedDecode binary data encoded byencodeOptimized(io.netty.buffer.ByteBuf)
- 
getRemoteChannels
- 
getRemoteModData
- 
getFMLNetworkVersionpublic int getFMLNetworkVersion()
- 
isTruncatedpublic boolean isTruncated()
- 
toStringReturns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
- 
channelsReturns the value of thechannelsrecord component.- Returns:
- the value of the channelsrecord component
 
- 
modsReturns the value of themodsrecord component.- Returns:
- the value of the modsrecord component
 
- 
fmlNetworkVerpublic int fmlNetworkVer()Returns the value of thefmlNetworkVerrecord component.- Returns:
- the value of the fmlNetworkVerrecord component
 
- 
truncatedpublic boolean truncated()Returns the value of thetruncatedrecord component.- Returns:
- the value of the truncatedrecord component
 
 
-