Record Class CommonRegisterPayload
java.lang.Object
java.lang.Record
net.neoforged.neoforge.network.payload.CommonRegisterPayload
- Record Components:
version- Declared version of all contained channels. Currently unused by NeoForge.protocol- TheConnectionProtocolof the contained channels. One of "play" or "configuration". Currently NeoForge only expects and sends "play" channels via this payload.channels- A list of all named channels available for the declared phase.
- All Implemented Interfaces:
CustomPacketPayload
@Internal
public record CommonRegisterPayload(int version, ConnectionProtocol protocol, Set<Identifier> channels)
extends Record
implements CustomPacketPayload
Common Register, used to send play-phase channels during the configuration phase.
-
Nested Class Summary
Nested classes/interfaces inherited from interface CustomPacketPayload
CustomPacketPayload.FallbackProvider<B>, CustomPacketPayload.Type<T>, CustomPacketPayload.TypeAndCodec<B,T> -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Set<Identifier> The field for thechannelsrecord component.static final Identifierprivate final ConnectionProtocolThe field for theprotocolrecord component.static final StreamCodec<FriendlyByteBuf, CommonRegisterPayload> static final CustomPacketPayload.Type<CommonRegisterPayload> private final intThe field for theversionrecord component. -
Constructor Summary
ConstructorsConstructorDescriptionCommonRegisterPayload(int version, ConnectionProtocol protocol, Set<Identifier> channels) Creates an instance of aCommonRegisterPayloadrecord class. -
Method Summary
Modifier and TypeMethodDescriptionchannels()Returns the value of thechannelsrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.protocol()Returns the value of theprotocolrecord component.private static @Nullable ConnectionProtocolprotocolById(String id) final StringtoString()Returns a string representation of this record class.type()intversion()Returns the value of theversionrecord component.Methods inherited from interface CustomPacketPayload
toVanillaClientbound, toVanillaServerbound
-
Field Details
-
Constructor Details
-
Method Details
-
type
- Specified by:
typein interfaceCustomPacketPayload
-
protocolById
-
toString
-
hashCode
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
version
-
protocol
-
channels
-