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
Modifier and TypeFieldDescriptionprivate final Set<ModdedNetworkComponent>
The field for theconfiguration
record component.static final ResourceLocation
private final Set<ModdedNetworkComponent>
The field for theplay
record component.static final FriendlyByteBuf.Reader<? extends CustomPacketPayload>
-
Constructor Summary
ConstructorDescriptionModdedNetworkPayload
(Set<ModdedNetworkComponent> configuration, Set<ModdedNetworkComponent> play) Creates an instance of aModdedNetworkPayload
record class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theconfiguration
record component.final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.id()
play()
Returns the value of theplay
record component.final String
toString()
Returns a string representation of this record class.void
write
(FriendlyByteBuf buf)
-
Field Details
-
configuration
The field for theconfiguration
record component. -
play
The field for theplay
record component. -
ID
-
READER
-
-
Constructor Details
-
ModdedNetworkPayload
-
ModdedNetworkPayload
public ModdedNetworkPayload(Set<ModdedNetworkComponent> configuration, Set<ModdedNetworkComponent> play) Creates an instance of aModdedNetworkPayload
record class.- Parameters:
configuration
- the value for theconfiguration
record componentplay
- the value for theplay
record component
-
-
Method Details
-
write
- Specified by:
write
in interfaceCustomPacketPayload
-
id
- Specified by:
id
in 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 theconfiguration
record component.- Returns:
- the value of the
configuration
record component
-
play
Returns the value of theplay
record component.- Returns:
- the value of the
play
record component
-