Record Class ServerboundDialoguePacket
java.lang.Object
java.lang.Record
de.luckymcdev.foundryengine.common.network.packets.dialogue.ServerboundDialoguePacket
- All Implemented Interfaces:
AbstractPacket<ServerboundDialoguePacket>, net.minecraft.network.protocol.common.custom.CustomPacketPayload
public record ServerboundDialoguePacket(ServerboundDialoguePacket.Action action, String optionId)
extends Record
implements AbstractPacket<ServerboundDialoguePacket>
Client-to-server packet for dialogue interaction.
Carries a SELECT_OPTION / ADVANCE_NEXT / END action and an optional optionId.
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface AbstractPacket
AbstractPacket.Definition<T>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.RegistryFriendlyByteBuf, ServerboundDialoguePacket> static final AbstractPacket.Definition<ServerboundDialoguePacket> static final net.minecraft.network.protocol.common.custom.CustomPacketPayload.Type<ServerboundDialoguePacket> Fields inherited from interface AbstractPacket
GENEROUS_NBT_CODEC, MAX_FILE_CONTENT_LENGTH, MAX_LIST_ELEMENT_COUNT, MAX_MODULE_COUNT, MAX_STRING_LENGTH -
Constructor Summary
ConstructorsConstructorDescriptionServerboundDialoguePacket(ServerboundDialoguePacket.Action action, String optionId) Creates an instance of aServerboundDialoguePacketrecord class. -
Method Summary
Modifier and TypeMethodDescriptionaction()Returns the value of theactionrecord component.static ServerboundDialoguePacketstatic ServerboundDialoguePacketend()final booleanIndicates whether some other object is "equal to" this one.net.minecraft.network.codec.StreamCodec<net.minecraft.network.RegistryFriendlyByteBuf, ServerboundDialoguePacket> getCodec()net.minecraft.network.protocol.common.custom.CustomPacketPayload.Type<ServerboundDialoguePacket> getType()final inthashCode()Returns a hash code value for this object.optionId()Returns the value of theoptionIdrecord component.static ServerboundDialoguePacketselectOption(String optionId) final StringtoString()Returns a string representation of this record class.Methods inherited from interface AbstractPacket
handleClient, handleServer, typeMethods 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<ServerboundDialoguePacket> TYPE -
CODEC
public static final net.minecraft.network.codec.StreamCodec<net.minecraft.network.RegistryFriendlyByteBuf, ServerboundDialoguePacket> CODEC -
DEFINITION
-
-
Constructor Details
-
ServerboundDialoguePacket
Creates an instance of aServerboundDialoguePacketrecord class.- Parameters:
action- the value for theactionrecord componentoptionId- the value for theoptionIdrecord component
-
-
Method Details
-
selectOption
-
advanceNext
-
end
-
getType
public net.minecraft.network.protocol.common.custom.CustomPacketPayload.Type<ServerboundDialoguePacket> getType()- Specified by:
getTypein interfaceAbstractPacket<ServerboundDialoguePacket>
-
getBoundTo
- Specified by:
getBoundToin interfaceAbstractPacket<ServerboundDialoguePacket>
-
getCodec
public net.minecraft.network.codec.StreamCodec<net.minecraft.network.RegistryFriendlyByteBuf, ServerboundDialoguePacket> getCodec()- Specified by:
getCodecin interfaceAbstractPacket<ServerboundDialoguePacket>
-
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. All components in this record class are compared withObjects::equals(Object,Object). -
action
Returns the value of theactionrecord component.- Returns:
- the value of the
actionrecord component
-
optionId
Returns the value of theoptionIdrecord component.- Returns:
- the value of the
optionIdrecord component
-