| Package | Description |
|---|---|
| com.github.steveice10.packetlib | |
| com.github.steveice10.packetlib.event.session | |
| com.github.steveice10.packetlib.packet | |
| com.github.steveice10.packetlib.tcp |
| Modifier and Type | Method and Description |
|---|---|
void |
Session.callPacketReceived(Packet packet)
Notifies all listeners that a packet was just received.
|
void |
Session.callPacketSent(Packet packet)
Notifies all listeners that a packet was just sent.
|
void |
Session.send(Packet packet)
Sends a packet.
|
| Modifier and Type | Method and Description |
|---|---|
<T extends Packet> |
PacketSendingEvent.getPacket()
Gets the packet involved in this event as the required type.
|
| Modifier and Type | Method and Description |
|---|---|
void |
SessionListener.packetReceived(Session session,
Packet packet)
Called when a session receives a packet.
|
void |
SessionAdapter.packetReceived(Session session,
Packet packet) |
void |
SessionListener.packetSent(Session session,
Packet packet)
Called when a session sends a packet.
|
void |
SessionAdapter.packetSent(Session session,
Packet packet) |
void |
PacketSendingEvent.setPacket(Packet packet)
Sets the packet that should be sent as a result of this event.
|
| Constructor and Description |
|---|
PacketSendingEvent(Session session,
Packet packet)
Creates a new PacketSendingEvent instance.
|
| Modifier and Type | Class and Description |
|---|---|
class |
PacketDefinition<T extends Packet>
Represents a definition of a packet with various
information about it, such as it's id, class and
factory for construction.
|
interface |
PacketFactory<T extends Packet>
Factory for constructing
Packets. |
| Modifier and Type | Class and Description |
|---|---|
class |
BufferedPacket |
| Modifier and Type | Method and Description |
|---|---|
<T extends Packet> |
PacketProtocol.register(int id,
Class<T> packet,
PacketFactory<T> factory)
Registers a packet to this protocol as both serverbound and clientbound.
|
<T extends Packet> |
PacketProtocol.registerClientbound(int id,
Class<T> packet,
PacketFactory<T> factory)
Registers a clientbound packet to this protocol.
|
<T extends Packet> |
PacketProtocol.registerServerbound(int id,
Class<T> packet,
PacketFactory<T> factory)
Registers a serverbound packet to this protocol.
|
| Modifier and Type | Method and Description |
|---|---|
Packet |
PacketProtocol.createClientboundPacket(int id,
NetInput in)
Creates a new instance of a clientbound packet with the given id and read the clientbound input.
|
Packet |
PacketProtocol.createServerboundPacket(int id,
NetInput in)
Creates a new instance of a serverbound packet with the given id and read the serverbound input.
|
| Modifier and Type | Method and Description |
|---|---|
Class<? extends Packet> |
PacketProtocol.getClientboundClass(int id)
Gets the packet class for a packet id.
|
Class<? extends Packet> |
BufferedPacket.getPacketClass() |
Class<? extends Packet> |
PacketProtocol.getServerboundClass(int id)
Gets the packet class for a packet id.
|
| Modifier and Type | Method and Description |
|---|---|
int |
PacketProtocol.getClientboundId(Packet packet)
Gets the registered id of a clientbound
Packet instance. |
int |
PacketProtocol.getServerboundId(Packet packet)
Gets the registered id of a serverbound
Packet instance. |
| Modifier and Type | Method and Description |
|---|---|
int |
PacketProtocol.getClientboundId(Class<? extends Packet> packetClass)
Gets the registered id of a clientbound packet class.
|
int |
PacketProtocol.getServerboundId(Class<? extends Packet> packetClass)
Gets the registered id of a serverbound packet class.
|
void |
PacketProtocol.register(PacketDefinition<? extends Packet> definition)
Registers a packet to this protocol as both serverbound and clientbound.
|
void |
PacketProtocol.registerClientbound(PacketDefinition<? extends Packet> definition)
Registers a clientbound packet to this protocol.
|
void |
PacketProtocol.registerServerbound(PacketDefinition<? extends Packet> definition)
Registers a serverbound packet to this protocol.
|
| Constructor and Description |
|---|
BufferedPacket(Class<? extends Packet> packetClass,
byte[] buf) |
| Modifier and Type | Method and Description |
|---|---|
void |
TcpSession.callPacketReceived(Packet packet) |
void |
TcpSession.callPacketSent(Packet packet) |
void |
TcpPacketCodec.encode(io.netty.channel.ChannelHandlerContext ctx,
Packet packet,
io.netty.buffer.ByteBuf buf) |
void |
TcpSession.send(Packet packet) |
Copyright © 2021. All rights reserved.