top 10 reasons to test your code in 2023 (tutorial)
This commit is contained in:
parent
8beaa3d290
commit
97b7a225fb
1 changed files with 4 additions and 4 deletions
|
@ -45,12 +45,12 @@ public class Client {
|
|||
this.session = session;
|
||||
|
||||
session.addListener(new SessionAdapter () {
|
||||
@Override public void packetReceived(Session session, Packet packet) { for (SessionListener listener : listeners) listener.packetReceived(session, packet); }
|
||||
@Override public void packetSending (PacketSendingEvent event) { for (SessionListener listener : listeners) listener.packetSending(event); }
|
||||
@Override public void packetSent (Session session, Packet packet) {
|
||||
@Override public void packetReceived (Session session, Packet packet) {
|
||||
if (packet instanceof ClientboundGameProfilePacket) profile = ((ClientboundGameProfilePacket) packet).getProfile();
|
||||
for (SessionListener listener : listeners) listener.packetSent(session, packet);
|
||||
for (SessionListener listener : listeners) listener.packetReceived(session, packet);
|
||||
}
|
||||
@Override public void packetSending (PacketSendingEvent event) { for (SessionListener listener : listeners) listener.packetSending(event); }
|
||||
@Override public void packetSent (Session session, Packet packet) { for (SessionListener listener : listeners) listener.packetSent(session, packet); }
|
||||
@Override public void packetError (PacketErrorEvent event) {
|
||||
event.getCause().printStackTrace();
|
||||
event.setSuppress(true);
|
||||
|
|
Loading…
Reference in a new issue