public class MinecraftProtocol
extends com.github.steveice10.packetlib.packet.PacketProtocol
| Constructor and Description |
|---|
MinecraftProtocol()
Constructs a new MinecraftProtocol instance for making status queries.
|
MinecraftProtocol(@NonNull com.github.steveice10.mc.auth.data.GameProfile profile,
String accessToken)
Constructs a new MinecraftProtocol instance for logging in.
|
MinecraftProtocol(PacketCodec codec)
Constructs a new MinecraftProtocol instance for making status queries.
|
MinecraftProtocol(@NonNull PacketCodec codec,
@NonNull com.github.steveice10.mc.auth.data.GameProfile profile,
String accessToken)
Constructs a new MinecraftProtocol instance for logging in.
|
MinecraftProtocol(@NonNull PacketCodec codec,
@NonNull String username)
Constructs a new MinecraftProtocol instance for logging in using offline mode.
|
MinecraftProtocol(@NonNull String username)
Constructs a new MinecraftProtocol instance for logging in using offline mode.
|
| Modifier and Type | Method and Description |
|---|---|
com.github.steveice10.packetlib.packet.Packet |
createClientboundPacket(int id,
com.github.steveice10.packetlib.io.NetInput in) |
com.github.steveice10.packetlib.packet.Packet |
createServerboundPacket(int id,
com.github.steveice10.packetlib.io.NetInput in) |
Class<? extends com.github.steveice10.packetlib.packet.Packet> |
getClientboundClass(int id) |
int |
getClientboundId(Class<? extends com.github.steveice10.packetlib.packet.Packet> packetClass) |
int |
getClientboundId(com.github.steveice10.packetlib.packet.Packet packet) |
com.github.steveice10.packetlib.packet.PacketHeader |
getPacketHeader() |
Class<? extends com.github.steveice10.packetlib.packet.Packet> |
getServerboundClass(int id) |
int |
getServerboundId(Class<? extends com.github.steveice10.packetlib.packet.Packet> packetClass) |
int |
getServerboundId(com.github.steveice10.packetlib.packet.Packet packet) |
String |
getSRVRecordPrefix() |
ProtocolState |
getState()
Gets the current
ProtocolState the client is in. |
void |
newClientSession(com.github.steveice10.packetlib.Session session) |
void |
newServerSession(com.github.steveice10.packetlib.Server server,
com.github.steveice10.packetlib.Session session) |
public MinecraftProtocol()
public MinecraftProtocol(PacketCodec codec)
codec - The packet codec to use.public MinecraftProtocol(@NonNull
@NonNull String username)
username - Username to use.public MinecraftProtocol(@NonNull
@NonNull PacketCodec codec,
@NonNull
@NonNull String username)
codec - The packet codec to use.username - Username to use.public MinecraftProtocol(@NonNull
@NonNull com.github.steveice10.mc.auth.data.GameProfile profile,
String accessToken)
profile - GameProfile to use.accessToken - Access token to use, or null if using offline mode.public MinecraftProtocol(@NonNull
@NonNull PacketCodec codec,
@NonNull
@NonNull com.github.steveice10.mc.auth.data.GameProfile profile,
String accessToken)
codec - The packet codec to use.profile - GameProfile to use.accessToken - Access token to use, or null if using offline mode.public String getSRVRecordPrefix()
getSRVRecordPrefix in class com.github.steveice10.packetlib.packet.PacketProtocolpublic com.github.steveice10.packetlib.packet.PacketHeader getPacketHeader()
getPacketHeader in class com.github.steveice10.packetlib.packet.PacketProtocolpublic void newClientSession(com.github.steveice10.packetlib.Session session)
newClientSession in class com.github.steveice10.packetlib.packet.PacketProtocolpublic void newServerSession(com.github.steveice10.packetlib.Server server,
com.github.steveice10.packetlib.Session session)
newServerSession in class com.github.steveice10.packetlib.packet.PacketProtocolpublic ProtocolState getState()
ProtocolState the client is in.ProtocolState.public com.github.steveice10.packetlib.packet.Packet createClientboundPacket(int id,
com.github.steveice10.packetlib.io.NetInput in)
throws IOException
createClientboundPacket in class com.github.steveice10.packetlib.packet.PacketProtocolIOExceptionpublic int getClientboundId(Class<? extends com.github.steveice10.packetlib.packet.Packet> packetClass)
getClientboundId in class com.github.steveice10.packetlib.packet.PacketProtocolpublic int getClientboundId(com.github.steveice10.packetlib.packet.Packet packet)
getClientboundId in class com.github.steveice10.packetlib.packet.PacketProtocolpublic Class<? extends com.github.steveice10.packetlib.packet.Packet> getClientboundClass(int id)
getClientboundClass in class com.github.steveice10.packetlib.packet.PacketProtocolpublic com.github.steveice10.packetlib.packet.Packet createServerboundPacket(int id,
com.github.steveice10.packetlib.io.NetInput in)
throws IOException
createServerboundPacket in class com.github.steveice10.packetlib.packet.PacketProtocolIOExceptionpublic int getServerboundId(Class<? extends com.github.steveice10.packetlib.packet.Packet> packetClass)
getServerboundId in class com.github.steveice10.packetlib.packet.PacketProtocolpublic int getServerboundId(com.github.steveice10.packetlib.packet.Packet packet)
getServerboundId in class com.github.steveice10.packetlib.packet.PacketProtocolpublic Class<? extends com.github.steveice10.packetlib.packet.Packet> getServerboundClass(int id)
getServerboundClass in class com.github.steveice10.packetlib.packet.PacketProtocolCopyright © 2021. All rights reserved.