use of gg.projecteden.nexus.framework.commands.models.annotations.Path in project Nexus by ProjectEdenGG.
the class BirthdaysCommand method birthday.
@Path("[amount]")
void birthday(@Arg("10") int amount) {
List<Nerd> nerds = service.getNerdsWithBirthdays();
nerds.sort((nerd1, nerd2) -> {
LocalDate now = LocalDate.now();
return (int) ChronoUnit.DAYS.between(now, getNextBirthday(nerd1)) - (int) ChronoUnit.DAYS.between(now, getNextBirthday(nerd2));
});
line();
send("&3Upcoming birthdays:");
line();
for (int i = 0; i < Math.min(amount, nerds.size()); i++) {
if (LocalDate.now().getDayOfYear() == getNextBirthday(nerds.get(i)).getDayOfYear())
send("&3" + (i + 1) + " &e" + Nickname.of(nerds.get(i)) + " &7- Today");
else {
long until = ChronoUnit.DAYS.between(LocalDate.now(), getNextBirthday(nerds.get(i)));
send(json().next("&3" + (i + 1) + " &e" + Nickname.of(nerds.get(i)) + " &7- " + until + plural(" day", until)).hover(nerds.get(i).getBirthday().format(DateTimeFormatter.ofPattern("MM/dd/yyyy"))));
}
}
}
use of gg.projecteden.nexus.framework.commands.models.annotations.Path in project Nexus by ProjectEdenGG.
the class BookCommand method edit.
@Path
void edit() {
checkCanEdit();
Material type = book.getType() == Material.WRITABLE_BOOK ? Material.WRITTEN_BOOK : Material.WRITABLE_BOOK;
ItemStack editable = new ItemStack(type, book.getAmount());
editable.setItemMeta(meta);
inventory().setItem(hand, editable);
}
use of gg.projecteden.nexus.framework.commands.models.annotations.Path in project Nexus by ProjectEdenGG.
the class ModReviewCommand method add.
@Permission(Group.ADMIN)
@Path("add <name> <verdict> [notes...]")
void add(String name, ModVerdict verdict, String notes) {
Mod mod = new Mod(name, verdict, notes);
modReview.add(mod);
save();
send(PREFIX + "Added mod &e" + mod.getName());
}
use of gg.projecteden.nexus.framework.commands.models.annotations.Path in project Nexus by ProjectEdenGG.
the class OnlineCommand method help.
@Path
@Override
public void help() {
long vanished = OnlinePlayers.getAll().stream().filter(PlayerUtils::isVanished).count();
long online = OnlinePlayers.getAll().size() - vanished;
boolean canSeeVanished = !isPlayer() || player().hasPermission("pv.see");
String counts = online + ((canSeeVanished && vanished > 0) ? " &3+ &e" + vanished : "");
line();
send("&3There are &e" + counts + " &3out of maximum &e" + Bukkit.getMaxPlayers() + " &3players online");
Rank.REVERSED.forEach(rank -> {
List<Nerd> nerds = rank.getOnlineNerds().stream().filter(this::canSee).collect(Collectors.toList());
if (nerds.size() == 0)
return;
JsonBuilder builder = new JsonBuilder(rank.getColoredName() + "s&f: ");
nerds.forEach(nerd -> getNameWithPresence(nerd, builder));
send(builder);
});
line();
send("&e&lClick &3on a player's name to open the &eQuickAction &3menu");
line();
}
use of gg.projecteden.nexus.framework.commands.models.annotations.Path in project Nexus by ProjectEdenGG.
the class BlockCenterCommand method pitch.
@Path("pitch")
void pitch() {
Location newLocation = location().clone();
newLocation.setPitch(centered.getPitch());
player().teleportAsync(newLocation);
}
Aggregations