Class WrapperHandshakingClientHandshake
java.lang.Object
com.github.retrooper.packetevents.wrapper.PacketWrapper<WrapperHandshakingClientHandshake>
com.github.retrooper.packetevents.wrapper.handshaking.client.WrapperHandshakingClientHandshake
public class WrapperHandshakingClientHandshake
extends PacketWrapper<WrapperHandshakingClientHandshake>
This packet is the first packet the client should send.
It contains important data such as the client's protocol version.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
Nested classes/interfaces inherited from class com.github.retrooper.packetevents.wrapper.PacketWrapper
PacketWrapper.Reader<T>, PacketWrapper.Writer<T>
-
Field Summary
Fields inherited from class com.github.retrooper.packetevents.wrapper.PacketWrapper
buffer, bufferLock, serverVersion, user
-
Constructor Summary
ConstructorDescriptionWrapperHandshakingClientHandshake
(int protocolVersion, String serverAddress, int serverPort, ConnectionState nextConnectionState) Deprecated.WrapperHandshakingClientHandshake
(int protocolVersion, String serverAddress, int serverPort, WrapperHandshakingClientHandshake.ConnectionIntention intention) -
Method Summary
Modifier and TypeMethodDescriptionvoid
copy
(WrapperHandshakingClientHandshake wrapper) ClientVersion
of the client.The next connection state.int
Protocol version of the client.Address of the server.int
Port of the server.void
read()
void
setClientVersion
(ClientVersion clientVersion) void
void
setNextConnectionState
(ConnectionState nextConnectionState) Deprecated.void
setProtocolVersion
(int protocolVersion) void
setServerAddress
(String serverAddress) void
setServerPort
(int serverPort) void
write()
Methods inherited from class com.github.retrooper.packetevents.wrapper.PacketWrapper
createUniversalPacketWrapper, getBuffer, getChunkKey, getChunkX, getChunkZ, getMaxMessageLength, getNativePacketId, getPacketId, getPacketTypeData, getRegistryHolder, getServerVersion, limitValue, prepareForSend, prepareForSend, readArray, readBitSet, readBlockPosition, readBoolean, readByte, readByteArray, readByteArray, readByteArrayOfSize, readBytes, readChatTypeBoundNetwork, readCollection, readComponent, readComponentAsJSON, readComponentAsNBT, readComponentJSON, readContainerId, readDimension, readDouble, readEntityMetadata, readEnum, readEnum, readEnumSet, readEvent, readFilterMask, readFloat, readGameMode, readIdentifier, readIdentifier, readInt, readItemStack, readItemStackModern, readKnownPack, readLastSeenMessages, readLastSeenMessagesEntry, readLastSeenMessagesPacked, readLastSeenMessagesUpdate, readLegacyLastSeenMessagesUpdate, readList, readLong, readLongArray, readLongArray, readMap, readMappedEntity, readMappedEntity, readMappedEntityOrDirect, readMappedEntityOrDirect, readMedium, readMerchantOffer, readMessageSignature, readMessageSignaturePacked, readMultiVersional, readNBT, readNBTRaw, readNode, readNullableVarInt, readOptional, readPresentItemStack, readPublicKey, readPublicProfileKey, readRemainingBytes, readRemoteChatSession, readRotation, readSaltSignature, readShort, readSignatureData, readSignedCommandArguments, readString, readString, readStyle, readTimestamp, readUnlimitedNBT, readUnlimitedNBTRaw, readUnsignedByte, readUnsignedShort, readUUID, readVarInt, readVarIntArray, readVarIntArrayOfSize, readVarLong, readVarShort, readVillagerData, readWorldBlockPosition, resetBuffer, resetByteBuf, setBuffer, setNativePacketId, setPacketId, setServerVersion, writeArray, writeBitSet, writeBlockPosition, writeBoolean, writeByte, writeByteArray, writeByteArrayOfSize, writeBytes, writeChatTypeBoundNetwork, writeCollection, writeComponent, writeComponentAsJSON, writeComponentAsNBT, writeComponentJSON, writeContainerId, writeDimension, writeDouble, writeEntityMetadata, writeEntityMetadata, writeEnum, writeEnumSet, writeFilterMask, writeFloat, writeGameMode, writeIdentifier, writeIdentifier, writeInt, writeItemStack, writeItemStackModern, writeKnownPack, writeLastMessagesEntry, writeLastSeenMessages, writeLastSeenMessagesPacked, writeLastSeenMessagesUpdate, writeLegacyLastSeenMessagesUpdate, writeList, writeLong, writeLongArray, writeMap, writeMappedEntity, writeMappedEntityOrDirect, writeMedium, writeMerchantOffer, writeMessageSignature, writeMessageSignaturePacked, writeMultiVersional, writeNBT, writeNBTRaw, writeNode, writeNullableVarInt, writeOptional, writePresentItemStack, writePublicKey, writePublicProfileKey, writeRemoteChatSession, writeRotation, writeSaltSignature, writeShort, writeSignatureData, writeSignedCommandArguments, writeString, writeString, writeString, writeStyle, writeTimestamp, writeUUID, writeVarInt, writeVarIntArray, writeVarIntArrayOfSize, writeVarLong, writeVarShort, writeVillagerData, writeWorldBlockPosition
-
Constructor Details
-
WrapperHandshakingClientHandshake
-
WrapperHandshakingClientHandshake
@Deprecated public WrapperHandshakingClientHandshake(int protocolVersion, String serverAddress, int serverPort, ConnectionState nextConnectionState) Deprecated. -
WrapperHandshakingClientHandshake
public WrapperHandshakingClientHandshake(int protocolVersion, String serverAddress, int serverPort, WrapperHandshakingClientHandshake.ConnectionIntention intention)
-
-
Method Details
-
read
public void read()- Overrides:
read
in classPacketWrapper<WrapperHandshakingClientHandshake>
-
write
public void write()- Overrides:
write
in classPacketWrapper<WrapperHandshakingClientHandshake>
-
copy
- Overrides:
copy
in classPacketWrapper<WrapperHandshakingClientHandshake>
-
getProtocolVersion
public int getProtocolVersion()Protocol version of the client. The latest vanilla server won't let clients with a different protocol version join the server.- Returns:
- Protocol version
-
setProtocolVersion
public void setProtocolVersion(int protocolVersion) -
getClientVersion
ClientVersion
of the client. This enum maps the protocol versions with the name of the release.- Overrides:
getClientVersion
in classPacketWrapper<WrapperHandshakingClientHandshake>
- Returns:
- Client version
-
setClientVersion
- Overrides:
setClientVersion
in classPacketWrapper<WrapperHandshakingClientHandshake>
-
getServerAddress
Address of the server.- Returns:
- Server address
-
setServerAddress
-
getServerPort
public int getServerPort()Port of the server.- Returns:
- Server port
-
setServerPort
public void setServerPort(int serverPort) -
getNextConnectionState
The next connection state. Should always beConnectionState.STATUS
orConnectionState.LOGIN
on the vanilla client.- Returns:
- Next connection state
-
setNextConnectionState
Deprecated. -
getIntention
-
setIntention
-
setIntention(ConnectionIntention)