Record Class ModdedNetworkPayload
java.lang.Object
java.lang.Record
net.neoforged.neoforge.network.payload.ModdedNetworkPayload
- Record Components:
configuration- The configuration components.play- The play components.
- All Implemented Interfaces:
CustomPacketPayload
@Internal
public record ModdedNetworkPayload(Set<ModdedNetworkComponent> configuration, Set<ModdedNetworkComponent> play)
extends Record
implements CustomPacketPayload
A payload that contains the modded network configuration and play components.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Set<ModdedNetworkComponent>The field for theconfigurationrecord component.static final ResourceLocationprivate final Set<ModdedNetworkComponent>The field for theplayrecord component.static final FriendlyByteBuf.Reader<? extends CustomPacketPayload> -
Constructor Summary
ConstructorsConstructorDescriptionModdedNetworkPayload(Set<ModdedNetworkComponent> configuration, Set<ModdedNetworkComponent> play) Creates an instance of aModdedNetworkPayloadrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theconfigurationrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.id()play()Returns the value of theplayrecord component.final StringtoString()Returns a string representation of this record class.voidwrite(FriendlyByteBuf buf)
-
Field Details
-
configuration
The field for theconfigurationrecord component. -
play
The field for theplayrecord component. -
ID
-
READER
-
-
Constructor Details
-
ModdedNetworkPayload
-
ModdedNetworkPayload
public ModdedNetworkPayload(Set<ModdedNetworkComponent> configuration, Set<ModdedNetworkComponent> play) Creates an instance of aModdedNetworkPayloadrecord class.- Parameters:
configuration- the value for theconfigurationrecord componentplay- the value for theplayrecord component
-
-
Method Details
-
write
- Specified by:
writein interfaceCustomPacketPayload
-
id
- Specified by:
idin interfaceCustomPacketPayload
-
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). -
configuration
Returns the value of theconfigurationrecord component.- Returns:
- the value of the
configurationrecord component
-
play
Returns the value of theplayrecord component.- Returns:
- the value of the
playrecord component
-