Record Class ModVersions
java.lang.Object
java.lang.Record
net.minecraftforge.network.packets.ModVersions
Prefixes S2CModList by sending additional data about the mods installed on the server to the client
The mod data is stored as follows: [modId -> [modName, modVersion]]
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final intprivate final Map<String, ModVersions.Info> The field for themodsrecord component.static final StreamCodec<FriendlyByteBuf, ModVersions> -
Constructor Summary
ConstructorsConstructorDescriptionModVersions(Map<String, ModVersions.Info> mods) Creates an instance of aModVersionsrecord class. -
Method Summary
Modifier and TypeMethodDescriptionstatic ModVersionscreate()static ModVersionsdecode(FriendlyByteBuf buf) voidencode(FriendlyByteBuf output) final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.mods()Returns the value of themodsrecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
mods
The field for themodsrecord component. -
STREAM_CODEC
-
MAX_LENGTH
private static final int MAX_LENGTH- See Also:
-
-
Constructor Details
-
ModVersions
Creates an instance of aModVersionsrecord class.- Parameters:
mods- the value for themodsrecord component
-
-
Method Details
-
create
-
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). -
mods
Returns the value of themodsrecord component.- Returns:
- the value of the
modsrecord component
-