diff --git a/proxy/src/main/java/net/md_5/bungee/ServerConnection.java b/proxy/src/main/java/net/md_5/bungee/ServerConnection.java index a61231bb..b29a5c0c 100644 --- a/proxy/src/main/java/net/md_5/bungee/ServerConnection.java +++ b/proxy/src/main/java/net/md_5/bungee/ServerConnection.java @@ -49,7 +49,7 @@ public class ServerConnection extends GenericConnection implements Server PacketStream stream = new PacketStream( socket.getInputStream(), socket.getOutputStream() ); stream.write( handshake ); - stream.write( new PacketCDClientStatus( (byte) 0 ) ); + stream.write( PacketCDClientStatus.CLIENT_LOGIN ); stream.readPacket(); byte[] loginResponse = stream.readPacket(); 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 b8ccdead..3051b31d 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 @@ -64,7 +64,7 @@ public abstract class DefinedPacket implements DataInput, DataOutput */ public byte[] getPacket() { - return packet == null ? out.toByteArray() : packet; + return packet == null ? packet = out.toByteArray() : packet; } @Override 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 7f854bea..08bdc103 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 @@ -8,6 +8,8 @@ import lombok.ToString; public class PacketCDClientStatus extends DefinedPacket { + public static PacketCDClientStatus CLIENT_LOGIN = new PacketCDClientStatus( (byte) 0 ); + /** * Sent from the client to the server upon respawn, *