@Override public void packetReceived(PacketReceivedEvent event) { if (replyPacket != null) { logger.warn("received more than one synchronous reply"); return; } if (!filter.test(event.getPacket())) return; replyPacket = event.getPacket(); synchronized (lock) { lock.notify(); } }
@Override public boolean test(PacketReceivedEvent event) { return typeFilter.test(event.getPacket()) && additionalTest((T) event.getPacket(), event); }
@Override public void filteredPacketReceived(PacketReceivedEvent event) { packetReceived((T) event.getPacket(), event); }