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);