Fix currently online for seen info.

This commit is contained in:
Jesse Boyd 2016-06-27 23:59:38 +10:00
parent 817a5bc16e
commit 29a0b68dcb
2 changed files with 12 additions and 9 deletions

View File

@ -454,6 +454,7 @@ public enum C {
* Info * Info
*/ */
NONE("None", "Info"), NONE("None", "Info"),
NOW("Now", "Info"),
NEVER("Never", "Info"), NEVER("Never", "Info"),
UNKNOWN("Unknown", "Info"), UNKNOWN("Unknown", "Info"),
EVERYONE("Everyone", "Info"), EVERYONE("Everyone", "Info"),

View File

@ -719,10 +719,18 @@ public class MainUtil {
String trusted = getPlayerList(plot.getTrusted()); String trusted = getPlayerList(plot.getTrusted());
String members = getPlayerList(plot.getMembers()); String members = getPlayerList(plot.getMembers());
String denied = getPlayerList(plot.getDenied()); String denied = getPlayerList(plot.getDenied());
String seen = C.UNKNOWN.s(); String seen;
if (Settings.Enabled_Components.PLOT_EXPIRY) { if (Settings.Enabled_Components.PLOT_EXPIRY) {
if (plot.isOnline()) {
seen = C.NOW.s();
} else {
int time = (int) (ExpireManager.IMP.getAge(plot) / 1000); int time = (int) (ExpireManager.IMP.getAge(plot) / 1000);
if (time != 0) {
seen = MainUtil.secToTime(time); seen = MainUtil.secToTime(time);
} else {
seen = C.UNKNOWN.s();
}
}
} else { } else {
seen = C.NEVER.s(); seen = C.NEVER.s();
} }
@ -741,9 +749,7 @@ public class MainUtil {
} }
} }
boolean build = plot.isAdded(player.getUUID()); boolean build = plot.isAdded(player.getUUID());
String owner = plot.getOwners().isEmpty() ? "unowned" : getPlayerList(plot.getOwners()); String owner = plot.getOwners().isEmpty() ? "unowned" : getPlayerList(plot.getOwners());
info = info.replace("%id%", plot.getId().toString()); info = info.replace("%id%", plot.getId().toString());
info = info.replace("%alias%", alias); info = info.replace("%alias%", alias);
info = info.replace("%num%", String.valueOf(num)); info = info.replace("%num%", String.valueOf(num));
@ -771,10 +777,6 @@ public class MainUtil {
String info; String info;
if (full && Settings.Ratings.CATEGORIES != null && Settings.Ratings.CATEGORIES.size() > 1) { if (full && Settings.Ratings.CATEGORIES != null && Settings.Ratings.CATEGORIES.size() > 1) {
double[] ratings = MainUtil.getAverageRatings(plot); double[] ratings = MainUtil.getAverageRatings(plot);
for (double v : ratings) {
}
String rating = ""; String rating = "";
String prefix = ""; String prefix = "";
for (int i = 0; i < ratings.length; i++) { for (int i = 0; i < ratings.length; i++) {