public static final void itemSort2(SeekableLittleEndianAccessor slea, MapleClient c) {
        slea.readInt(); // timestamp
        byte mode = slea.readByte();
        if (mode < 0 || mode > 5) {
            return;
        }
        MapleInventory Inv = c.getPlayer().getInventory(MapleInventoryType.getByType(mode));
        ArrayList<Item> itemarray = new ArrayList<Item>();
        for (Iterator<IItem> it = Inv.iterator(); it.hasNext();) {
            Item item = (Item) it.next();
            itemarray.add((Item) (item.copy()));
        }
        Collections.sort(itemarray);
        for (IItem item : itemarray) {
            MapleInventoryManipulator.removeById(c, MapleInventoryType.getByType(mode), item.getItemId(), item.getQuantity(), false, false);
        }
        for (Item i : itemarray) {
            MapleInventoryManipulator.addFromDrop(c, i, false);
        }
        c.getSession().write(MaplePacketCreator.finishedSort2(mode));
        c.getSession().write(MaplePacketCreator.enableActions());
    }