Merge pull request #14 from Maxetto/master

Up
This commit is contained in:
Gabriele C. 2015-07-10 22:50:16 +02:00
commit c2932b3f5d

View File

@ -107,7 +107,7 @@ public class AdminCommand implements CommandExecutor {
return true; return true;
} }
if (Integer.parseInt(args[1]) < 30) { if (Integer.parseInt(args[1]) < 30) {
sender.sendMessage("You can only purge data older than 30 days") sender.sendMessage("You can only purge data older than 30 days");
return true; return true;
} }
try { try {
@ -234,39 +234,36 @@ public class AdminCommand implements CommandExecutor {
}); });
return true; return true;
} else { } else {
final CommandSender fSender = sender;
final String[] arguments = args;
Bukkit.getScheduler().scheduleSyncDelayedTask(plugin, new Runnable() { Bukkit.getScheduler().scheduleSyncDelayedTask(plugin, new Runnable() {
@Override @Override
public void run() { public void run() {
String message = "[AuthMe] "; String message = "[AuthMe] ";
if (arguments[1] != null) { if (args[1] == null) {
List<String> accountList = plugin.database.getAllAuthsByIp(arguments[1]); sender.sendMessage("[AuthMe] Please put a valid IP");
if (accountList.isEmpty() || accountList == null) { return true;
fSender.sendMessage("[AuthMe] Please put a valid IP");
return;
}
if (accountList.size() == 1) {
fSender.sendMessage("[AuthMe] " + arguments[1] + " is a single account player");
return;
}
int i = 0;
for (String account : accountList) {
i++;
message = message + account;
if (i != accountList.size()) {
message = message + ", ";
} else {
message = message + ".";
}
}
fSender.sendMessage("[AuthMe] " + arguments[1] + " has " + String.valueOf(accountList.size()) + " accounts");
fSender.sendMessage(message);
} else {
fSender.sendMessage("[AuthMe] Please put a valid IP");
return;
} }
List<String> accountList = plugin.database.getAllAuthsByIp(args[1]);
if (accountList.isEmpty() || accountList == null) {
sender.sendMessage("[AuthMe] This IP does not exist in the database");
return true;
}
if (accountList.size() == 1) {
sender.sendMessage("[AuthMe] " + args[1] + " is a single account player");
return true;
}
int i = 0;
for (String account : accountList) {
i++;
message = message + account;
if (i != accountList.size()) {
message = message + ", ";
} else {
message = message + ".";
}
}
sender.sendMessage("[AuthMe] " + args[1] + " has " + String.valueOf(accountList.size()) + " accounts");
sender.sendMessage(message);
} }
}); });
return true; return true;