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<ResourceLocation> 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 net.minecraft.network.protocol.common.custom.CustomPacketPayload
CustomPacketPayload.FallbackProvider<B extends FriendlyByteBuf>, CustomPacketPayload.Type<T extends CustomPacketPayload>, CustomPacketPayload.TypeAndCodec<B extends FriendlyByteBuf,T extends CustomPacketPayload> -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Set<ResourceLocation> The field for thechannelsrecord component.static final ResourceLocationprivate 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<ResourceLocation> 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 class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface net.minecraft.network.protocol.common.custom.CustomPacketPayload
toVanillaClientbound, toVanillaServerbound
-
Field Details
-
Constructor Details
-
CommonRegisterPayload
public CommonRegisterPayload(int version, ConnectionProtocol protocol, Set<ResourceLocation> channels) Creates an instance of aCommonRegisterPayloadrecord class.
-
-
Method Details
-
type
- Specified by:
typein interfaceCustomPacketPayload
-
protocolById
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
version
public int version()Returns the value of theversionrecord component.- Returns:
- the value of the
versionrecord component
-
protocol
Returns the value of theprotocolrecord component.- Returns:
- the value of the
protocolrecord component
-
channels
Returns the value of thechannelsrecord component.- Returns:
- the value of the
channelsrecord component
-