Record Class CommonRegisterPayload
java.lang.Object
java.lang.Record
net.fabricmc.fabric.impl.networking.CommonRegisterPayload
- All Implemented Interfaces:
net.minecraft.network.protocol.common.custom.CustomPacketPayload
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.minecraft.network.protocol.common.custom.CustomPacketPayload
net.minecraft.network.protocol.common.custom.CustomPacketPayload.FallbackProvider<B>, net.minecraft.network.protocol.common.custom.CustomPacketPayload.Type<T>, net.minecraft.network.protocol.common.custom.CustomPacketPayload.TypeAndCodec<B,T> -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final net.minecraft.network.codec.StreamCodec<net.minecraft.network.FriendlyByteBuf, CommonRegisterPayload> static final Stringstatic final Stringstatic final net.minecraft.network.protocol.common.custom.CustomPacketPayload.Type<CommonRegisterPayload> -
Constructor Summary
ConstructorsConstructorDescriptionCommonRegisterPayload(int version, String protocol, Set<net.minecraft.resources.Identifier> channels) Creates an instance of aCommonRegisterPayloadrecord class. -
Method Summary
Modifier and TypeMethodDescriptionSet<net.minecraft.resources.Identifier> channels()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.final StringtoString()Returns a string representation of this record class.net.minecraft.network.protocol.common.custom.CustomPacketPayload.Type<CommonRegisterPayload> type()intversion()Returns the value of theversionrecord component.voidwrite(net.minecraft.network.FriendlyByteBuf buf) Methods inherited from interface net.minecraft.network.protocol.common.custom.CustomPacketPayload
toVanillaClientbound, toVanillaServerbound
-
Field Details
-
TYPE
public static final net.minecraft.network.protocol.common.custom.CustomPacketPayload.Type<CommonRegisterPayload> TYPE -
CODEC
public static final net.minecraft.network.codec.StreamCodec<net.minecraft.network.FriendlyByteBuf, CommonRegisterPayload> CODEC -
PLAY_PROTOCOL
- See Also:
-
CONFIGURATION_PROTOCOL
- See Also:
-
-
Constructor Details
-
CommonRegisterPayload
public CommonRegisterPayload(int version, String protocol, Set<net.minecraft.resources.Identifier> channels) Creates an instance of aCommonRegisterPayloadrecord class.- Parameters:
version- the value for theversionrecord componentprotocol- the value for theprotocolrecord componentchannels- the value for thechannelsrecord component
-
-
Method Details
-
write
public void write(net.minecraft.network.FriendlyByteBuf buf) -
type
public net.minecraft.network.protocol.common.custom.CustomPacketPayload.Type<CommonRegisterPayload> type()- Specified by:
typein interfacenet.minecraft.network.protocol.common.custom.CustomPacketPayload
-
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
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
-