Record Class ServerboundCommandSuggestionPacket
java.lang.Object
java.lang.Record
net.minecraft.network.protocol.game.ServerboundCommandSuggestionPacket
- All Implemented Interfaces:
Packet<ServerGamePacketListener>
public record ServerboundCommandSuggestionPacket(int id, String command)
extends Record
implements Packet<ServerGamePacketListener>
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StreamCodec<io.netty.buffer.ByteBuf, ServerboundCommandSuggestionPacket> private final StringThe field for thecommandrecord component.private final intThe field for theidrecord component.static final StreamCodec<io.netty.buffer.ByteBuf, ServerboundCommandSuggestionPacket> -
Constructor Summary
ConstructorsConstructorDescriptionServerboundCommandSuggestionPacket(int id, String command) Creates an instance of aServerboundCommandSuggestionPacketrecord class. -
Method Summary
Modifier and TypeMethodDescriptioncommand()Returns the value of thecommandrecord component.private static StreamCodec<io.netty.buffer.ByteBuf, ServerboundCommandSuggestionPacket> createStreamCodec(int maxLength) final booleanIndicates whether some other object is "equal to" this one.voidhandle(ServerGamePacketListener listener) final inthashCode()Returns a hash code value for this object.intid()Returns the value of theidrecord component.final StringtoString()Returns a string representation of this record class.type()Methods inherited from interface Packet
isSkippable, isTerminal
-
Field Details
-
id
private final int idThe field for theidrecord component. -
command
The field for thecommandrecord component. -
STREAM_CODEC
public static final StreamCodec<io.netty.buffer.ByteBuf, ServerboundCommandSuggestionPacket> STREAM_CODEC -
CHAT_ONLY_STREAM_CODEC
public static final StreamCodec<io.netty.buffer.ByteBuf, ServerboundCommandSuggestionPacket> CHAT_ONLY_STREAM_CODEC
-
-
Constructor Details
-
ServerboundCommandSuggestionPacket
Creates an instance of aServerboundCommandSuggestionPacketrecord class.- Parameters:
id- the value for theidrecord componentcommand- the value for thecommandrecord component
-
-
Method Details
-
createStreamCodec
private static StreamCodec<io.netty.buffer.ByteBuf, ServerboundCommandSuggestionPacket> createStreamCodec(int maxLength) -
type
- Specified by:
typein interfacePacket<ServerGamePacketListener>
-
handle
- Specified by:
handlein interfacePacket<ServerGamePacketListener>
-
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. -
id
public int id()Returns the value of theidrecord component.- Returns:
- the value of the
idrecord component
-
command
Returns the value of thecommandrecord component.- Returns:
- the value of the
commandrecord component
-