Record Class ConnectionData.ModMismatchData
java.lang.Object
java.lang.Record
net.minecraftforge.network.ConnectionData.ModMismatchData
- 记录组件:
mismatchedModData
- The data of the mismatched or missing mods/channels, consisting of the mod or channel id and the version of the respective mod. If the mod version is absent, the entry is assumed to be missing on either side. If it is present, the entry gets treated as a mismatch.presentModData
- The data of the channels/mods from the side the mismatch data doesn't originate from, consisting of the mod or channel id and the name and version of the respective mod. This data is useful for a proper comparison against the mismatched channel data. The data is stored like this: [id -> [modName, modVersion]]mismatchedDataFromServer
- Whether the mismatched data originates from the server. Note, that the mismatched data origin does not tell us if the actual mismatch check happened on the client or the server.
- 封闭类:
- ConnectionData
public static record ConnectionData.ModMismatchData(Map<ResourceLocation,String> mismatchedModData, Map<ResourceLocation,org.apache.commons.lang3.tuple.Pair<String,String>> presentModData, boolean mismatchedDataFromServer)
extends Record
A class for holding the mod mismatch data of a failed handshake.
Contains a list of mismatched channels, the channels present on the side the handshake failed on, the mods with mismatching registries (if available) and the information of whether the mismatching data's origin is the server.
-
字段概要
字段修饰符和类型字段说明private final boolean
mismatchedDataFromServer
记录组件的字段。private final Map<ResourceLocation,
String> mismatchedModData
记录组件的字段。private final Map<ResourceLocation,
org.apache.commons.lang3.tuple.Pair<String, String>> presentModData
记录组件的字段。 -
构造器概要
构造器构造器说明ModMismatchData
(Map<ResourceLocation, String> mismatchedModData, Map<ResourceLocation, org.apache.commons.lang3.tuple.Pair<String, String>> presentModData, boolean mismatchedDataFromServer) 创建ModMismatchData
记录的实例。 -
方法概要
修饰符和类型方法说明channel
(Map<ResourceLocation, String> mismatchedChannels, ConnectionData connectionData, boolean mismatchedDataFromServer) Creates a ModMismatchData instance from given channel mismatch data, which is processed side-aware depending on the value of mismatchedDataFromServerboolean
private static Map<ResourceLocation,
String> enhanceWithModVersion
(Map<ResourceLocation, String> mismatchedChannels, ConnectionData connectionData, boolean mismatchedDataFromServer) Enhances a map of mismatched channels with the corresponding mod version.final boolean
指示某个其他对象是否“等于”此对象。private static Map<ResourceLocation,
org.apache.commons.lang3.tuple.Pair<String, String>> getPresentChannelData
(Set<ResourceLocation> mismatchedChannelsFilter, ConnectionData connectionData, boolean mismatchedDataFromServer) Queries the channel data from the side the mismatched data isn't from, in order to provide a map of all the present channels for a proper comparison against the mismatched channel data.private static org.apache.commons.lang3.tuple.Pair<ResourceLocation,
org.apache.commons.lang3.tuple.Pair<String, String>> getPresentModDataFromChannel
(ResourceLocation channel, ConnectionData connectionData, boolean mismatchedDataFromServer) Queries the mod data from a given channel id from the side the mismatched data isn't from.private static Map<ResourceLocation,
org.apache.commons.lang3.tuple.Pair<String, String>> getServerSidePresentModData
(Set<ResourceLocation> mismatchedModsFilter, ConnectionData connectionData) Queries the mod data from the server side.final int
hashCode()
返回此对象的哈希代码值。boolean
返回mismatchedDataFromServer
记录组件的值。返回mismatchedModData
记录组件的值。Map<ResourceLocation,
org.apache.commons.lang3.tuple.Pair<String, String>> 返回presentModData
记录组件的值。registry
(com.google.common.collect.Multimap<ResourceLocation, ResourceLocation> mismatchedRegistryData, ConnectionData connectionData) Creates a ModMismatchData instance from given mismatched registry entries.final String
toString()
返回此记录的字符串表示形式。
-
字段详细资料
-
mismatchedModData
mismatchedModData
记录组件的字段。 -
presentModData
private final Map<ResourceLocation,org.apache.commons.lang3.tuple.Pair<String, presentModDataString>> presentModData
记录组件的字段。 -
mismatchedDataFromServer
private final boolean mismatchedDataFromServermismatchedDataFromServer
记录组件的字段。
-
-
构造器详细资料
-
ModMismatchData
public ModMismatchData(Map<ResourceLocation, String> mismatchedModData, Map<ResourceLocation, org.apache.commons.lang3.tuple.Pair<String, String>> presentModData, boolean mismatchedDataFromServer) 创建ModMismatchData
记录的实例。- 参数:
mismatchedModData
-mismatchedModData
记录组件的值presentModData
-presentModData
记录组件的值mismatchedDataFromServer
-mismatchedDataFromServer
记录组件的值
-
-
方法详细资料
-
channel
public static ConnectionData.ModMismatchData channel(Map<ResourceLocation, String> mismatchedChannels, ConnectionData connectionData, boolean mismatchedDataFromServer) Creates a ModMismatchData instance from given channel mismatch data, which is processed side-aware depending on the value of mismatchedDataFromServer- 参数:
mismatchedChannels
- The list of channels that were listed as mismatches, either because they are missing on one side or because their versions mismatchedconnectionData
- The connection data instance responsible for collecting the server mod data.mismatchedDataFromServer
- Whether the mismatched data originates from the server.
-
registry
public static ConnectionData.ModMismatchData registry(com.google.common.collect.Multimap<ResourceLocation, ResourceLocation> mismatchedRegistryData, ConnectionData connectionData) Creates a ModMismatchData instance from given mismatched registry entries. In this case, the mismatched data is always treated as originating from the client because registry entries missing on the server never cause the handshake to fail.- 参数:
mismatchedRegistryData
- The list of mismatched registries and the associated mismatched registry entries. The data is stored like this: "registryNamespace:registryPath" -> "entryNamespace:entryPath"connectionData
- The connection data instance responsible for collecting the server mod data.
-
containsMismatches
public boolean containsMismatches()- 返回:
- true if this ModMismatchData instance contains channel or registry mismatches
-
enhanceWithModVersion
private static Map<ResourceLocation,String> enhanceWithModVersion(Map<ResourceLocation, String> mismatchedChannels, ConnectionData connectionData, boolean mismatchedDataFromServer) Enhances a map of mismatched channels with the corresponding mod version.- 参数:
mismatchedChannels
- The original mismatched channel list, containing the id and version of the mismatched channel.connectionData
- The connection data instance responsible for collecting the server mod data.mismatchedDataFromServer
- Whether the mismatched data originates from the server. The given mismatched channel list gets processed side-aware depending on the value of this parameter.- 返回:
- A map containing the id of the channel and the version of the corresponding mod, or NetworkRegistry.ABSENT if the channel is missing.
-
getPresentChannelData
private static Map<ResourceLocation,org.apache.commons.lang3.tuple.Pair<String, getPresentChannelDataString>> (Set<ResourceLocation> mismatchedChannelsFilter, ConnectionData connectionData, boolean mismatchedDataFromServer) Queries the channel data from the side the mismatched data isn't from, in order to provide a map of all the present channels for a proper comparison against the mismatched channel data.- 参数:
mismatchedChannelsFilter
- A filter that gets used in order to only query the data of mismatched mods, because that's the only one we need for a proper comparison between mismatched and present mods.connectionData
- The connection data instance responsible for collecting the server mod data.mismatchedDataFromServer
- Whether the mismatched data originates from the server. The data gets queried from the side that the mismatch data does not originate from.- 返回:
- The data of all relevant present channels, containing the channel id and the name and version of the corresponding mod.
-
getPresentModDataFromChannel
private static org.apache.commons.lang3.tuple.Pair<ResourceLocation,org.apache.commons.lang3.tuple.Pair<String, getPresentModDataFromChannelString>> (ResourceLocation channel, ConnectionData connectionData, boolean mismatchedDataFromServer) Queries the mod data from a given channel id from the side the mismatched data isn't from.- 参数:
channel
- The id of the channel the mod data should be queried for.connectionData
- The connection data instance responsible for collecting the server mod data.mismatchedDataFromServer
- Whether the mismatched data originates from the server. The data gets queried from the side that the mismatch data does not originate from.- 返回:
- The mod data corresponding to the channel id, containing the channel id and the name and version of the corresponding mod.
-
getServerSidePresentModData
private static Map<ResourceLocation,org.apache.commons.lang3.tuple.Pair<String, getServerSidePresentModDataString>> (Set<ResourceLocation> mismatchedModsFilter, ConnectionData connectionData) Queries the mod data from the server side. Useful in case of a registry mismatch, which always gets detected on the client.- 参数:
mismatchedModsFilter
- A filter that gets used in order to only query the data of mismatched mods, because that's the only one we need for a proper comparison between mismatched and present mods.connectionData
- The connection data instance responsible for collecting the server mod data.- 返回:
- The mod data from the server, containing the channel id and the name and version of the corresponding mod.
-
toString
返回此记录的字符串表示形式。此表示形式包含类型的名称,后跟每个记录组件的名称和值。 -
hashCode
public final int hashCode()返回此对象的哈希代码值。此值派生自每个记录组件的哈希代码。 -
equals
指示某个其他对象是否“等于”此对象。如果两个对象属于同一个类,而且所有记录组件都相等,则这两个对象相等。 使用Objects::equals(Object,Object)
对参考组件进行比较;使用 '==' 对基元组件进行比较 -
mismatchedModData
返回mismatchedModData
记录组件的值。- 返回:
mismatchedModData
记录组件的值
-
presentModData
返回presentModData
记录组件的值。- 返回:
presentModData
记录组件的值
-
mismatchedDataFromServer
public boolean mismatchedDataFromServer()返回mismatchedDataFromServer
记录组件的值。- 返回:
mismatchedDataFromServer
记录组件的值
-