Fixed space returning every result and commented stuff

Analysis attempt commented
Fixed search displaying everything with -p argument.
This commit is contained in:
Rsl1122 2016-12-15 21:48:41 +02:00
parent 5756c21e5b
commit 9375797ca8
3 changed files with 27 additions and 28 deletions

View File

@ -71,9 +71,9 @@ public class SearchCommand extends SubCommand {
//header //header
sender.sendMessage(textColor + "-- [" + operatorColor + "PLAN - Search results: took " + DataFormatUtils.formatTimeAmountSinceDate(refreshDate, new Date()) + textColor + "] --"); 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()) { for (String playerName : dataLists.keySet()) {
sender.sendMessage(textColor + "Results for: " + playerName); sender.sendMessage(textColor + "Matching player: " + playerName);
for (String[] dataString : dataLists.get(playerName)) { for (String[] dataString : dataLists.get(playerName)) {
sender.sendMessage("" + operatorColor + dataString[0].charAt(4) + dataString[0].toLowerCase().substring(5) + ": " + textColor + dataString[1]); sender.sendMessage("" + operatorColor + dataString[0].charAt(4) + dataString[0].toLowerCase().substring(5) + ": " + textColor + dataString[1]);
} }

View File

@ -63,27 +63,27 @@ public class Analysis {
timeKeys.addAll(Arrays.asList(timeValues)); timeKeys.addAll(Arrays.asList(timeValues));
// Attempt to determine if undefined data is usable // Attempt to determine if undefined data is usable
List<String> unusedKeys = new ArrayList<>(); // List<String> unusedKeys = new ArrayList<>();
unusedKeys.addAll(playerDataLists.keySet()); // unusedKeys.addAll(playerDataLists.keySet());
unusedKeys.removeAll(numberKeys); // unusedKeys.removeAll(numberKeys);
unusedKeys.removeAll(boolKeys); // unusedKeys.removeAll(boolKeys);
unusedKeys.removeAll(timeKeys); // unusedKeys.removeAll(timeKeys);
unusedKeys.removeAll(ignoreKeys); // unusedKeys.removeAll(ignoreKeys);
for (String key : unusedKeys) { // for (String key : unusedKeys) {
try { // try {
Double.parseDouble(playerDataLists.get(key).get(0)); // Double.parseDouble(playerDataLists.get(key).get(0));
numberKeys.add(key); // numberKeys.add(key);
continue; // continue;
} catch (Exception e) { // } catch (Exception e) {
//
} // }
try { // try {
Boolean.parseBoolean(playerDataLists.get(key).get(0)); // Boolean.parseBoolean(playerDataLists.get(key).get(0));
boolKeys.add(key); // boolKeys.add(key);
} catch (Exception e) { // } catch (Exception e) {
//
} // }
} // }
HashMap<String, String> averagesAndPercents = new HashMap<>(); HashMap<String, String> averagesAndPercents = new HashMap<>();
int errors = 0; int errors = 0;

View File

@ -168,11 +168,6 @@ public class DataFormatUtils {
String[] returnArray = new String[args.length]; String[] returnArray = new String[args.length];
argloop: argloop:
for (int i = 0; i < args.length; i++) { for (int i = 0; i < args.length; i++) {
if (args[i].equals("-p")) {
args[0] = "";
returnArray[0] = "";
returnArray[i] = "";
}
for (String s : aac) { for (String s : aac) {
if (args[i].toLowerCase().contains(s)) { if (args[i].toLowerCase().contains(s)) {
returnArray[i] = "AAC"; returnArray[i] = "AAC";
@ -204,6 +199,10 @@ public class DataFormatUtils {
} }
} }
returnArray[i] = args[i]; returnArray[i] = args[i];
if (args[i].equals("-p")) {
returnArray[0] = args[0]+"_(Playername)";
returnArray[i] = "---";
}
} }
return returnArray; return returnArray;
} }