use of gg.projecteden.nexus.framework.commands.models.annotations.Permission in project Nexus by ProjectEdenGG.
the class DyeStationCommand method dye.
@Path("stain <stain>")
@Permission(Group.STAFF)
void dye(StainChoice stainChoice) {
ItemStack item = getToolRequired();
Colored.of(stainChoice.getColor()).apply(item);
}
use of gg.projecteden.nexus.framework.commands.models.annotations.Permission in project Nexus by ProjectEdenGG.
the class StaffHallCommand method update.
@Async
@SneakyThrows
@Path("update")
@Permission(Group.ADMIN)
void update() {
Map<StaffHallRankGroup, List<Nerd>> groups = new HashMap<>();
Rank.getStaffNerds().get().forEach((rank, nerds) -> groups.computeIfAbsent(StaffHallRankGroup.of(rank), $ -> new ArrayList<>()).addAll(nerds));
groups.forEach((group, nerds) -> nerds.sort(new SeniorityComparator(group)));
AtomicInteger wait = new AtomicInteger();
groups.forEach((group, nerds) -> {
final List<Integer> npcIds = config.getNpcIds(group);
for (int index = 0; index < npcIds.size(); index++) {
final int i = index;
Tasks.wait(wait.getAndAdd(20), () -> {
Integer npcId = npcIds.get(i);
if (nerds.size() >= (i + 1))
updateNpc(npcId, nerds.get(i));
else
despawnNpc(npcId);
});
}
});
}
use of gg.projecteden.nexus.framework.commands.models.annotations.Permission in project Nexus by ProjectEdenGG.
the class NerdCommand method setFirstJoin.
@Path("setFirstJoin <player> <date>")
@Permission(Group.ADMIN)
void setFirstJoin(Nerd nerd, LocalDateTime firstJoin) {
new NerdService().edit(nerd, _nerd -> _nerd.setFirstJoin(firstJoin));
send(PREFIX + "Set " + nerd.getNickname() + "'s first join date to &e" + shortDateTimeFormat(nerd.getFirstJoin()));
}
use of gg.projecteden.nexus.framework.commands.models.annotations.Permission in project Nexus by ProjectEdenGG.
the class NerdCommand method setPromotionDate.
@Path("setPromotionDate <player> <date>")
@Permission(Group.ADMIN)
void setPromotionDate(Nerd nerd, LocalDate promotionDate) {
new NerdService().edit(nerd, _nerd -> _nerd.setPromotionDate(promotionDate));
send(PREFIX + "Set " + nerd.getNickname() + "'s promotion date to &e" + shortDateFormat(nerd.getPromotionDate()));
}
use of gg.projecteden.nexus.framework.commands.models.annotations.Permission in project Nexus by ProjectEdenGG.
the class RadioCommand method listListeners.
// Staff Commands
@Path("players <radio>")
@Description("Lists all players listening to the server radio")
@Permission(Group.STAFF)
void listListeners(Radio radio) {
Set<UUID> uuids = radio.getSongPlayer().getPlayerUUIDs();
if (uuids.size() == 0)
error("No players are listening to " + radio.getId());
send(PREFIX + "Players listening to " + radio.getId() + ":");
int ndx = 1;
for (UUID uuid : uuids) {
send("&3" + ndx++ + " &e" + Nickname.of(uuid));
}
}
Aggregations