From 97b7a225fb032404e5d456d9e137097d246e2140 Mon Sep 17 00:00:00 2001 From: Chipmunk <65827213+ChipmunkMC@users.noreply.github.com> Date: Sun, 30 Apr 2023 21:36:33 -0400 Subject: [PATCH] top 10 reasons to test your code in 2023 (tutorial) --- src/main/java/land/chipmunk/chipmunkbot/Client.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/land/chipmunk/chipmunkbot/Client.java b/src/main/java/land/chipmunk/chipmunkbot/Client.java index cec4f9d..1173bbc 100644 --- a/src/main/java/land/chipmunk/chipmunkbot/Client.java +++ b/src/main/java/land/chipmunk/chipmunkbot/Client.java @@ -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);