Search in sources :

Example 1 with Permission

use of gg.projecteden.nexus.framework.commands.models.annotations.Permission 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());
}
Also used : Mod(gg.projecteden.nexus.models.modreview.ModReview.Mod) Path(gg.projecteden.nexus.framework.commands.models.annotations.Path) Permission(gg.projecteden.nexus.framework.commands.models.annotations.Permission)

Example 2 with Permission

use of gg.projecteden.nexus.framework.commands.models.annotations.Permission in project Nexus by ProjectEdenGG.

the class BuildContestCommand method item.

@Path("setup item <theme...>")
@Permission(Group.ADMIN)
void item(String theme) {
    ItemStack item = getToolRequired();
    item.setAmount(1);
    ItemBuilder.setName(item, "&6&lBuild Contest");
    ItemBuilder.addLore(item, "&e&lJoin our latest build contest!");
    ItemBuilder.addLore(item, "&e&lTheme: &6&l" + theme);
    buildContest.setItemStack(item);
    buildContest.setTheme(theme);
    save();
    send(PREFIX + "Saved the item to the item in your hand");
}
Also used : ItemStack(org.bukkit.inventory.ItemStack) Path(gg.projecteden.nexus.framework.commands.models.annotations.Path) Permission(gg.projecteden.nexus.framework.commands.models.annotations.Permission)

Example 3 with Permission

use of gg.projecteden.nexus.framework.commands.models.annotations.Permission in project Nexus by ProjectEdenGG.

the class TeleportCommand method disable.

@Path("toggle")
@Permission("ladder.builder")
void disable() {
    SettingService settingService = new SettingService();
    Setting setting = settingService.get(player(), "tpDisable");
    boolean enable = setting.getBoolean();
    setting.setBoolean(!enable);
    settingService.save(setting);
    send(PREFIX + "Teleports to you have been " + (enable ? "&aenabled" : "&cdisabled"));
}
Also used : SettingService(gg.projecteden.nexus.models.setting.SettingService) Setting(gg.projecteden.nexus.models.setting.Setting) Path(gg.projecteden.nexus.framework.commands.models.annotations.Path) Permission(gg.projecteden.nexus.framework.commands.models.annotations.Permission)

Example 4 with Permission

use of gg.projecteden.nexus.framework.commands.models.annotations.Permission in project Nexus by ProjectEdenGG.

the class Pugmas20Command method treeGet.

@Permission(Group.ADMIN)
@Path("tree get")
void treeGet() {
    Material logs = getTargetBlockRequired().getType();
    PugmasTreeType treeType = PugmasTreeType.of(logs);
    if (treeType == null)
        error("Pugmas Tree with logs " + camelCase(logs) + " not found");
    send(PREFIX + "You are looking at a " + camelCase(treeType) + " tree");
}
Also used : PugmasTreeType(gg.projecteden.nexus.features.events.y2020.pugmas20.quests.OrnamentVendor.PugmasTreeType) Material(org.bukkit.Material) Path(gg.projecteden.nexus.framework.commands.models.annotations.Path) Permission(gg.projecteden.nexus.framework.commands.models.annotations.Permission)

Example 5 with Permission

use of gg.projecteden.nexus.framework.commands.models.annotations.Permission in project Nexus by ProjectEdenGG.

the class Pugmas20Command method treeCounts.

@Permission(Group.ADMIN)
@Path("tree counts")
void treeCounts() {
    int total = 0;
    JsonBuilder json = json(PREFIX + "Pugmas tree counts:");
    for (PugmasTreeType treeType : PugmasTreeType.values()) {
        Set<Integer> ids = treeType.getPasters().keySet();
        if (ids.size() == 0)
            continue;
        String collect = ids.stream().map(String::valueOf).collect(Collectors.joining(", "));
        json.newline().next("&e " + camelCase(treeType) + " &7- " + ids.size() + " &3[" + collect + "]");
        total += ids.size();
    }
    if (total == 0)
        error("No pugmas trees found");
    send(json.newline().next("&3Total: &e" + total));
}
Also used : JsonBuilder(gg.projecteden.nexus.utils.JsonBuilder) PugmasTreeType(gg.projecteden.nexus.features.events.y2020.pugmas20.quests.OrnamentVendor.PugmasTreeType) Pugmas20.showWaypoint(gg.projecteden.nexus.features.events.y2020.pugmas20.Pugmas20.showWaypoint) Path(gg.projecteden.nexus.framework.commands.models.annotations.Path) Permission(gg.projecteden.nexus.framework.commands.models.annotations.Permission)

Aggregations

Permission (gg.projecteden.nexus.framework.commands.models.annotations.Permission)94 Path (gg.projecteden.nexus.framework.commands.models.annotations.Path)93 Async (gg.projecteden.annotations.Async)15 JsonBuilder (gg.projecteden.nexus.utils.JsonBuilder)13 ItemStack (org.bukkit.inventory.ItemStack)13 List (java.util.List)10 CustomCommand (gg.projecteden.nexus.framework.commands.models.CustomCommand)9 Group (gg.projecteden.nexus.framework.commands.models.annotations.Permission.Group)9 CommandEvent (gg.projecteden.nexus.framework.commands.models.events.CommandEvent)9 Arg (gg.projecteden.nexus.framework.commands.models.annotations.Arg)8 Description (gg.projecteden.nexus.framework.commands.models.annotations.Description)8 ArrayList (java.util.ArrayList)8 Nerd (gg.projecteden.nexus.models.nerd.Nerd)7 NerdService (gg.projecteden.nexus.models.nerd.NerdService)7 Utils (gg.projecteden.nexus.utils.Utils)7 HashMap (java.util.HashMap)7 BiFunction (java.util.function.BiFunction)7 Map (java.util.Map)6 Location (org.bukkit.Location)6 Aliases (gg.projecteden.nexus.framework.commands.models.annotations.Aliases)5