mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-21 20:56:45 +01:00
parent
a77a51b6f2
commit
eb334b3aac
@ -57,7 +57,8 @@ public class Info extends SubCommand {
|
||||
if (args.length > 0) {
|
||||
arg = args[0];
|
||||
switch (arg) {
|
||||
case "trusted", "alias", "inv", "biome", "denied", "flags", "id", "size", "members", "creationdate", "seen", "owner", "rating", "likes" -> plot = Plot
|
||||
// TODO: (re?)implement /plot info inv. (it was never properly implemented)
|
||||
case "trusted", "alias", "biome", "denied", "flags", "id", "size", "members", "creationdate", "seen", "owner", "rating", "likes" -> plot = Plot
|
||||
.getPlotFromString(player, null, false);
|
||||
default -> {
|
||||
plot = Plot.getPlotFromString(player, arg, false);
|
||||
|
@ -2928,14 +2928,21 @@ public class Plot {
|
||||
Template flagsTemplate = Template.of("flags", flags);
|
||||
Template creationTemplate = Template.of("creationdate", newDate);
|
||||
Template buildTemplate = Template.of("build", String.valueOf(build));
|
||||
if (iInfo.getComponent(player).contains("<rating>")) {
|
||||
Template sizeTemplate = Template.of("size", String.valueOf(getConnectedPlots().size()));
|
||||
String component = iInfo.getComponent(player);
|
||||
if (component.contains("<rating>") || component.contains("<likes>")) {
|
||||
TaskManager.runTaskAsync(() -> {
|
||||
Template ratingTemplate;
|
||||
Template likesTemplate;
|
||||
if (Settings.Ratings.USE_LIKES) {
|
||||
ratingTemplate = Template.of(
|
||||
"rating",
|
||||
String.format("%.0f%%", Like.getLikesPercentage(this) * 100D)
|
||||
);
|
||||
likesTemplate = Template.of(
|
||||
"likes",
|
||||
String.format("%.0f%%", Like.getLikesPercentage(this) * 100D)
|
||||
);
|
||||
} else {
|
||||
int max = 10;
|
||||
if (Settings.Ratings.CATEGORIES != null && !Settings.Ratings.CATEGORIES.isEmpty()) {
|
||||
@ -2962,6 +2969,7 @@ public class Plot {
|
||||
);
|
||||
}
|
||||
}
|
||||
likesTemplate = Template.of("likes", "N/A");
|
||||
}
|
||||
future.complete(StaticCaption.of(MINI_MESSAGE.serialize(MINI_MESSAGE
|
||||
.parse(
|
||||
@ -2984,6 +2992,8 @@ public class Plot {
|
||||
buildTemplate,
|
||||
ratingTemplate,
|
||||
creationTemplate,
|
||||
sizeTemplate,
|
||||
likesTemplate,
|
||||
footerTemplate
|
||||
))));
|
||||
});
|
||||
@ -3008,6 +3018,8 @@ public class Plot {
|
||||
seenTemplate,
|
||||
flagsTemplate,
|
||||
buildTemplate,
|
||||
creationTemplate,
|
||||
sizeTemplate,
|
||||
footerTemplate
|
||||
))));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user