From 9375797ca8671823a92c4e3447d3aa45f240a605 Mon Sep 17 00:00:00 2001 From: Rsl1122 Date: Thu, 15 Dec 2016 21:48:41 +0200 Subject: [PATCH] Fixed space returning every result and commented stuff Analysis attempt commented Fixed search displaying everything with -p argument. --- .../plan/command/commands/SearchCommand.java | 4 +- .../plan/command/utils/Analysis.java | 42 +++++++++---------- .../plan/command/utils/DataFormatUtils.java | 9 ++-- 3 files changed, 27 insertions(+), 28 deletions(-) diff --git a/src/com/djrapitops/plan/command/commands/SearchCommand.java b/src/com/djrapitops/plan/command/commands/SearchCommand.java index c6c385c0a..caf0b4cc2 100644 --- a/src/com/djrapitops/plan/command/commands/SearchCommand.java +++ b/src/com/djrapitops/plan/command/commands/SearchCommand.java @@ -71,9 +71,9 @@ public class SearchCommand extends SubCommand { //header sender.sendMessage(textColor + "-- [" + operatorColor + "PLAN - Search results: took " + DataFormatUtils.formatTimeAmountSinceDate(refreshDate, new Date()) + textColor + "] --"); - + sender.sendMessage(operatorColor + "Results for: " + Arrays.toString(args)); for (String playerName : dataLists.keySet()) { - sender.sendMessage(textColor + "Results for: " + playerName); + sender.sendMessage(textColor + "Matching player: " + playerName); for (String[] dataString : dataLists.get(playerName)) { sender.sendMessage("" + operatorColor + dataString[0].charAt(4) + dataString[0].toLowerCase().substring(5) + ": " + textColor + dataString[1]); } diff --git a/src/com/djrapitops/plan/command/utils/Analysis.java b/src/com/djrapitops/plan/command/utils/Analysis.java index 05e1713c4..9a5d3f606 100644 --- a/src/com/djrapitops/plan/command/utils/Analysis.java +++ b/src/com/djrapitops/plan/command/utils/Analysis.java @@ -63,27 +63,27 @@ public class Analysis { timeKeys.addAll(Arrays.asList(timeValues)); // Attempt to determine if undefined data is usable - List unusedKeys = new ArrayList<>(); - unusedKeys.addAll(playerDataLists.keySet()); - unusedKeys.removeAll(numberKeys); - unusedKeys.removeAll(boolKeys); - unusedKeys.removeAll(timeKeys); - unusedKeys.removeAll(ignoreKeys); - for (String key : unusedKeys) { - try { - Double.parseDouble(playerDataLists.get(key).get(0)); - numberKeys.add(key); - continue; - } catch (Exception e) { - - } - try { - Boolean.parseBoolean(playerDataLists.get(key).get(0)); - boolKeys.add(key); - } catch (Exception e) { - - } - } +// List unusedKeys = new ArrayList<>(); +// unusedKeys.addAll(playerDataLists.keySet()); +// unusedKeys.removeAll(numberKeys); +// unusedKeys.removeAll(boolKeys); +// unusedKeys.removeAll(timeKeys); +// unusedKeys.removeAll(ignoreKeys); +// for (String key : unusedKeys) { +// try { +// Double.parseDouble(playerDataLists.get(key).get(0)); +// numberKeys.add(key); +// continue; +// } catch (Exception e) { +// +// } +// try { +// Boolean.parseBoolean(playerDataLists.get(key).get(0)); +// boolKeys.add(key); +// } catch (Exception e) { +// +// } +// } HashMap averagesAndPercents = new HashMap<>(); int errors = 0; diff --git a/src/com/djrapitops/plan/command/utils/DataFormatUtils.java b/src/com/djrapitops/plan/command/utils/DataFormatUtils.java index cdc6445c0..f1d0c7861 100644 --- a/src/com/djrapitops/plan/command/utils/DataFormatUtils.java +++ b/src/com/djrapitops/plan/command/utils/DataFormatUtils.java @@ -168,11 +168,6 @@ public class DataFormatUtils { String[] returnArray = new String[args.length]; argloop: for (int i = 0; i < args.length; i++) { - if (args[i].equals("-p")) { - args[0] = ""; - returnArray[0] = ""; - returnArray[i] = ""; - } for (String s : aac) { if (args[i].toLowerCase().contains(s)) { returnArray[i] = "AAC"; @@ -204,6 +199,10 @@ public class DataFormatUtils { } } returnArray[i] = args[i]; + if (args[i].equals("-p")) { + returnArray[0] = args[0]+"_(Playername)"; + returnArray[i] = "---"; + } } return returnArray; }