public void processPackets(Player player,List<DataPacket> packets){
  if (packets.isEmpty())   return;
  List<Byte> filter=new ArrayList<>();
  for (  DataPacket packet : packets) {
switch (packet.pid()) {
case ProtocolInfo.USE_ITEM_PACKET:
      if (!filter.contains(ProtocolInfo.USE_ITEM_PACKET)) {
        player.handleDataPacket(packet);
        filter.add(ProtocolInfo.USE_ITEM_PACKET);
      }
    break;
default :
  player.handleDataPacket(packet);
}
}
}

public void processPackets ( Player player , List < DataPacket > packets ) { if ( packets . isEmpty ( ) ) return ; List < Byte > filter = new ArrayList < > ( ) ; for ( DataPacket packet : packets ) { switch ( packet . pid ( ) ) { case ProtocolInfo . USE_ITEM_PACKET : if ( ! filter . contains ( ProtocolInfo . USE_ITEM_PACKET ) ) { player . handleDataPacket ( packet ) ; filter . add ( ProtocolInfo . USE_ITEM_PACKET ) ; } break ; default : player . handleDataPacket ( packet ) ; } } }
process packets obtained from batch packets required to perform additional analyses and filter unnecessary packets
