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
-
Field Summary
Modifier and TypeFieldDescriptionprivate static final int
private final Map
<String, ModVersions.Info> The field for themods
record component.static final StreamCodec
<FriendlyByteBuf, ModVersions> -
Constructor Summary
ConstructorDescriptionModVersions
(Map<String, ModVersions.Info> mods) Creates an instance of aModVersions
record class. -
Method Summary
Modifier and TypeMethodDescriptionstatic ModVersions
create()
static ModVersions
decode
(FriendlyByteBuf buf) void
encode
(FriendlyByteBuf output) final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.mods()
Returns the value of themods
record component.final String
toString()
Returns a string representation of this record class.
-
Field Details
-
mods
The field for themods
record component. -
STREAM_CODEC
-
MAX_LENGTH
private static final int MAX_LENGTH- See Also:
-
-
Constructor Details
-
ModVersions
Creates an instance of aModVersions
record class.- Parameters:
mods
- the value for themods
record 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 themods
record component.- Returns:
- the value of the
mods
record component
-