use of gg.projecteden.nexus.framework.commands.models.annotations.Permission in project Nexus by ProjectEdenGG.
the class AltBanCommand method bots.
@Permission(Group.ADMIN)
@Path("bots <names> [--dryrun]")
void bots(@Arg(type = String.class) List<String> names, @Switch boolean dryrun) {
int banned = 0;
int ignored = 0;
for (String name : names) {
try {
Nerd nerd = Nerd.of(name);
if (!nerd.getPastNames().contains(name))
throw new PlayerNotFoundException(name);
++banned;
if (dryrun)
send("Banning " + name);
else
Punishments.of(nerd).add(Punishment.ofType(PunishmentType.ALT_BAN).punisher(uuid()).input("Spam bot").now(true));
} catch (PlayerNotFoundException ex) {
send("Ignoring " + name);
++ignored;
} catch (Exception ex) {
ex.printStackTrace();
}
}
send("Banned " + banned + ", ignored " + ignored);
}
use of gg.projecteden.nexus.framework.commands.models.annotations.Permission in project Nexus by ProjectEdenGG.
the class Easter21Command method topLocations.
@Path("topLocations [page]")
@Permission(Group.ADMIN)
void topLocations(@Arg("1") int page) {
Map<Location, Integer> counts = new HashMap<>() {
{
for (Easter21User user : new Easter21UserService().getAll()) for (Location location : user.getFound()) put(location, getOrDefault(location, 0) + 1);
}
};
send(PREFIX + "Most found eggs");
BiFunction<Location, String, JsonBuilder> formatter = (location, index) -> json(index + " &e" + getCoordinateString(location) + " &7- " + counts.get(location)).command(getTeleportCommand(location)).hover("&eClick to teleport");
paginate(Utils.sortByValueReverse(counts).keySet(), formatter, "/easter topLocations", page);
}
use of gg.projecteden.nexus.framework.commands.models.annotations.Permission in project Nexus by ProjectEdenGG.
the class Easter21Command method start.
@Path("start")
@Permission(Group.ADMIN)
void start() {
List<Warp> locations = WarpType.EASTER21.getAll();
for (Warp warp : locations) warp.getLocation().getBlock().setType(Material.DRAGON_EGG);
send(PREFIX + "Created " + locations.size() + " easter eggs");
}
use of gg.projecteden.nexus.framework.commands.models.annotations.Permission in project Nexus by ProjectEdenGG.
the class Easter21Command method end.
@Path("end")
@Permission(Group.ADMIN)
void end() {
List<Warp> locations = WarpType.EASTER21.getAll();
for (Warp warp : locations) warp.getLocation().getBlock().setType(Material.AIR);
send(PREFIX + "Deleted " + locations.size() + " easter eggs");
}
use of gg.projecteden.nexus.framework.commands.models.annotations.Permission in project Nexus by ProjectEdenGG.
the class ItemTagsCommand method getTags.
@Path("get")
@Description("Get item tags on held item")
@Permission(Group.ADMIN)
void getTags() {
ItemStack tool = getToolRequired();
send("");
send("Item Tags: ");
Condition condition = Condition.of(tool);
if (condition != null)
send(condition.getTag());
Rarity rarity = Rarity.of(tool, condition);
if (rarity != null)
send(rarity.getTag());
send("");
}
Aggregations