diff --git a/proxy/src/main/java/net/md_5/bungee/packet/DefinedPacket.java b/proxy/src/main/java/net/md_5/bungee/packet/DefinedPacket.java index 421fe87d..e8d0914c 100644 --- a/proxy/src/main/java/net/md_5/bungee/packet/DefinedPacket.java +++ b/proxy/src/main/java/net/md_5/bungee/packet/DefinedPacket.java @@ -105,10 +105,8 @@ public abstract class DefinedPacket implements ByteBuf if ( constructor != null ) { buf.markReaderIndex(); - buf.markWriterIndex(); ret = constructor.newInstance( buf ); buf.resetReaderIndex(); - buf.resetWriterIndex(); } } catch ( IllegalAccessException | InstantiationException | InvocationTargetException | NoSuchMethodException ex ) { diff --git a/proxy/src/main/java/net/md_5/bungee/packet/Packet1Login.java b/proxy/src/main/java/net/md_5/bungee/packet/Packet1Login.java index 533cd4db..d8bb34bd 100644 --- a/proxy/src/main/java/net/md_5/bungee/packet/Packet1Login.java +++ b/proxy/src/main/java/net/md_5/bungee/packet/Packet1Login.java @@ -27,6 +27,13 @@ public class Packet1Login extends DefinedPacket writeByte( difficulty ); writeByte( unused ); writeByte( maxPlayers ); + this.entityId = entityId; + this.levelType = levelType; + this.gameMode = gameMode; + this.dimension = dimension; + this.difficulty = difficulty; + this.unused = unused; + this.maxPlayers = maxPlayers; } Packet1Login(ByteBuf buf) diff --git a/proxy/src/main/java/net/md_5/bungee/packet/Packet2Handshake.java b/proxy/src/main/java/net/md_5/bungee/packet/Packet2Handshake.java index 2a494926..0908a8db 100644 --- a/proxy/src/main/java/net/md_5/bungee/packet/Packet2Handshake.java +++ b/proxy/src/main/java/net/md_5/bungee/packet/Packet2Handshake.java @@ -21,6 +21,10 @@ public class Packet2Handshake extends DefinedPacket writeString( username ); writeString( host ); writeInt( port ); + this.procolVersion = protocolVersion; + this.username = username; + this.host = host; + this.port = port; } Packet2Handshake(ByteBuf buf) diff --git a/proxy/src/main/java/net/md_5/bungee/packet/Packet3Chat.java b/proxy/src/main/java/net/md_5/bungee/packet/Packet3Chat.java index 7ad898df..f9de2991 100644 --- a/proxy/src/main/java/net/md_5/bungee/packet/Packet3Chat.java +++ b/proxy/src/main/java/net/md_5/bungee/packet/Packet3Chat.java @@ -15,6 +15,7 @@ public class Packet3Chat extends DefinedPacket { super( 0x03 ); writeString( message ); + this.message = message; } Packet3Chat(ByteBuf buf) diff --git a/proxy/src/main/java/net/md_5/bungee/packet/Packet9Respawn.java b/proxy/src/main/java/net/md_5/bungee/packet/Packet9Respawn.java index a086d8e6..49aa371d 100644 --- a/proxy/src/main/java/net/md_5/bungee/packet/Packet9Respawn.java +++ b/proxy/src/main/java/net/md_5/bungee/packet/Packet9Respawn.java @@ -25,6 +25,11 @@ public class Packet9Respawn extends DefinedPacket writeByte( gameMode ); writeShort( worldHeight ); writeString( levelType ); + this.dimension = dimension; + this.difficulty = difficulty; + this.gameMode = gameMode; + this.worldHeight = worldHeight; + this.levelType = levelType; } Packet9Respawn(ByteBuf buf) diff --git a/proxy/src/main/java/net/md_5/bungee/packet/PacketCDClientStatus.java b/proxy/src/main/java/net/md_5/bungee/packet/PacketCDClientStatus.java index 9773bc31..1084c9ad 100644 --- a/proxy/src/main/java/net/md_5/bungee/packet/PacketCDClientStatus.java +++ b/proxy/src/main/java/net/md_5/bungee/packet/PacketCDClientStatus.java @@ -9,6 +9,10 @@ import lombok.ToString; public class PacketCDClientStatus extends DefinedPacket { + /** + * Represents the packet the client sends to the server when it is ready to + * login. + */ public static PacketCDClientStatus CLIENT_LOGIN = new PacketCDClientStatus( (byte) 0 ); /** diff --git a/proxy/src/main/java/net/md_5/bungee/packet/PacketFCEncryptionResponse.java b/proxy/src/main/java/net/md_5/bungee/packet/PacketFCEncryptionResponse.java index 38f885a8..f98d7e7d 100644 --- a/proxy/src/main/java/net/md_5/bungee/packet/PacketFCEncryptionResponse.java +++ b/proxy/src/main/java/net/md_5/bungee/packet/PacketFCEncryptionResponse.java @@ -24,6 +24,8 @@ public class PacketFCEncryptionResponse extends DefinedPacket super( 0xFC ); writeArray( sharedSecret ); writeArray( verifyToken ); + this.sharedSecret = sharedSecret; + this.verifyToken = verifyToken; } PacketFCEncryptionResponse(ByteBuf buf)