Small cleanup of packet classes
This commit is contained in:
parent
6525502836
commit
f0a19e0f45
@ -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 )
|
||||
{
|
||||
|
@ -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)
|
||||
|
@ -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)
|
||||
|
@ -15,6 +15,7 @@ public class Packet3Chat extends DefinedPacket
|
||||
{
|
||||
super( 0x03 );
|
||||
writeString( message );
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
Packet3Chat(ByteBuf buf)
|
||||
|
@ -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)
|
||||
|
@ -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 );
|
||||
|
||||
/**
|
||||
|
@ -24,6 +24,8 @@ public class PacketFCEncryptionResponse extends DefinedPacket
|
||||
super( 0xFC );
|
||||
writeArray( sharedSecret );
|
||||
writeArray( verifyToken );
|
||||
this.sharedSecret = sharedSecret;
|
||||
this.verifyToken = verifyToken;
|
||||
}
|
||||
|
||||
PacketFCEncryptionResponse(ByteBuf buf)
|
||||
|
Loading…
Reference in New Issue
Block a user