int dist = Integer.MAX_VALUE;
final int pX = methods.players.getMyPlayer().getLocation().getX();
final int pY = methods.players.getMyPlayer().getLocation().getY();
final int minX = pX - 52, minY = pY - 52;
final int maxX = pX + 52, maxY = pY + 52;
RSGroundItem itm = null;
for (int x = minX; x <= maxX; x++) {
for (int y = minY; y <= maxY; y++) {
final RSGroundItem[] items = getAllAt(x, y);
for (final RSGroundItem item : items) {
if (item != null && filter.accept(item) && methods.calc.distanceTo(item.getLocation()) < dist) {