Record Class MismatchData
java.lang.Object
java.lang.Record
net.minecraftforge.network.packets.MismatchData
public record MismatchData(Map<ResourceLocation,NetworkContext.NetworkMismatchData.Version> mismatched, Set<ResourceLocation> missing)
extends Record
Notifies the client of a channel mismatch on the server, so a
ModMismatchDisconnectedScreen is used to notify the user of the disconnection.
This packet also sends the data of a channel mismatch (currently, the ids and versions of the mismatched channels) to the client for it to display the correct information in said screen.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final intprivate final Map<ResourceLocation,NetworkContext.NetworkMismatchData.Version> The field for themismatchedrecord component.private final Set<ResourceLocation>The field for themissingrecord component. -
Constructor Summary
ConstructorsConstructorDescriptionMismatchData(Map<ResourceLocation, NetworkContext.NetworkMismatchData.Version> mismatched, Set<ResourceLocation> missing) Creates an instance of aMismatchDatarecord class. -
Method Summary
Modifier and TypeMethodDescriptionstatic MismatchDatadecode(FriendlyByteBuf buf) voidencode(FriendlyByteBuf buf) final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Returns the value of themismatchedrecord component.missing()Returns the value of themissingrecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
mismatched
The field for themismatchedrecord component. -
missing
The field for themissingrecord component. -
MAX_LENGTH
private static final int MAX_LENGTH- See Also:
-
-
Constructor Details
-
MismatchData
-
MismatchData
public MismatchData(Map<ResourceLocation, NetworkContext.NetworkMismatchData.Version> mismatched, Set<ResourceLocation> missing) Creates an instance of aMismatchDatarecord class.- Parameters:
mismatched- the value for themismatchedrecord componentmissing- the value for themissingrecord component
-
-
Method Details
-
decode
-
encode
-
toString
Returns 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. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates 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. All components in this record class are compared withObjects::equals(Object,Object). -
mismatched
Returns the value of themismatchedrecord component.- Returns:
- the value of the
mismatchedrecord component
-
missing
Returns the value of themissingrecord component.- Returns:
- the value of the
missingrecord component
-