use of gg.projecteden.nexus.framework.commands.models.annotations.Description in project Nexus by ProjectEdenGG.
the class HoursCommand method top2.
// TODO Update paginate to support database-level pagination
@Async
@Description("View the play time leaderboard for any year, month, or day")
@Path("top [args...]")
void top2(@Arg("1") HoursTopArguments args, @Switch boolean onlyStaff) {
int page = args.getPage();
List<PageResult> results = service.getPage(args);
String onlyStaffSwitch = "";
if (onlyStaff) {
onlyStaffSwitch = " --onlyStaff";
results.removeIf(result -> !Rank.of(result.getUuid()).isStaff());
}
if (results.size() == 0)
error("&cNo results on page " + page);
int totalHours = 0;
for (PageResult result : results) totalHours += result.getTotal();
send("");
send(PREFIX + "Total: " + Timespan.ofSeconds(totalHours).format() + (page > 1 ? "&e | &3Page " + page : ""));
BiFunction<PageResult, String, JsonBuilder> formatter = (result, index) -> json(index + " &e" + Nerd.of(result.getUuid()).getColoredName() + " &7- " + Timespan.ofSeconds(result.getTotal()).format());
paginate(results, formatter, "/hours top " + args.getInput() + onlyStaffSwitch, page);
}
use of gg.projecteden.nexus.framework.commands.models.annotations.Description in project Nexus by ProjectEdenGG.
the class ModReviewCommand method request.
@Cooldown(value = TickTime.SECOND, x = 30)
@Path("request <name> [notes...]")
@Description("Request a mod to be reviewed by the staff team")
void request(String name, String notes) {
ModReviewRequest request = new ModReviewRequest(uuid(), name, notes);
modReview.request(request);
save();
send(PREFIX + "Requested mod &e" + name + " &3to be reviewed");
String message = "&e" + name() + " &3has requested mod &e" + name + " &3to be reviewed";
Broadcast.staff().prefix("ModReview").message(json(message).command("/modreview requests")).send();
}
use of gg.projecteden.nexus.framework.commands.models.annotations.Description in project Nexus by ProjectEdenGG.
the class BankCommand method wallet.
@Path("[player]")
@Description("Displays all currencies owned by the player")
void wallet(@Arg("self") Nerd nerd) {
send(PREFIX + "&e" + nerd.getNickname() + "&3's Wallet: ");
// Store Credit
Contributor contributor = new ContributorService().get(nerd);
send("&3Store Credit: &e" + contributor.getCreditFormatted());
// Vote Points
Voter voter = new VoterService().get(nerd);
send("&3Vote Points: &e" + voter.getPoints());
// Event Store
EventUser eventUser = new EventUserService().get(nerd);
send("&3Event Tokens: &e" + eventUser.getTokens());
// Minigames
PerkOwner perkOwner = new PerkOwnerService().get(nerd);
send("&3Minigame Tokens: &e" + perkOwner.getTokens());
// Economy
send("&3Economy Balances: &e");
Banker banker = new BankerService().get(nerd);
Map<ShopGroup, BigDecimal> balances = banker.getBalances();
for (ShopGroup shopGroup : balances.keySet()) {
String name = StringUtils.camelCase(shopGroup);
String bal = banker.getBalanceFormatted(shopGroup);
send("&3 - " + name + ": &e" + bal);
}
line();
}
use of gg.projecteden.nexus.framework.commands.models.annotations.Description in project Nexus by ProjectEdenGG.
the class Pugmas20Command method advent.
@Path("advent")
@Description("Open the Advent menu")
void advent() {
LocalDate now = LocalDate.now();
if (!isAdmin()) {
if (isBeforePugmas(now))
error("Soon™ (" + timeLeft + ")");
if (isPastPugmas(now))
error("Next year!");
if (isSecondChance(now))
now = now.withYear(2020).withMonth(12).withDayOfMonth(25);
}
AdventMenu.openAdvent(player(), now);
}
use of gg.projecteden.nexus.framework.commands.models.annotations.Description in project Nexus by ProjectEdenGG.
the class Pugmas20Command method waypoint.
@Path("waypoint <day>")
@Description("Get directions to a chest you have already found")
void waypoint(int day) {
if (!pugmasUser.getLocatedDays().contains(day))
error("You have not located that chest yet");
AdventChest adventChest = AdventChests.getAdventChest(day);
if (adventChest == null)
error("Advent chest is null");
showWaypoint(adventChest, player());
}
Aggregations