public GroundItem getNearest(Tile tile, Filter<GroundItem> filter) {
        List<GroundItem> items = new ArrayList<GroundItem>();
        IClient client = ctx.getClient();

        INodeDeque[][] deques = client.getGroundItems()[client.getPlane()];

        GroundItem item = null;
        for (int x = 0; x < 104; x++) {
            for (int y = 0; y < 104; y++) {
                INodeDeque deq = deques[x][y];

                if (deq == null) {
                    continue;
                }

                NodeDeque<INode> deque = new NodeDeque<INode>(deq);

                for (INode node = deque.front(); node != null; node = deque.next()) {
                    IItem i = (IItem) node.prev();

                    GroundItem ii = new GroundItem(ctx, i.getId(), i.getAmount(), new Tile(client.getOriginX() + x, client.getOriginY() + y, x, y));

                    if (item == null) {
                        item = ii;
                    } else if (Perspective.edist_tile(tile, ii.getLocation()) < Perspective.edist_tile(tile, ii.getLocation())) {
                        item = ii;
                    }

                    if (filter == null || filter.accept(item)) {
                        items.add(item);
                    }
                }
            }
        }
        return item;
    }