Search in sources :

Example 91 with Permission

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

the class MinigamesCommand method copy.

@Path("copy <from> <to>")
@Permission(PERMISSION_MANAGE)
void copy(Arena arena, String name) {
    if (ArenaManager.exists(name))
        error("&e" + name + " already exists");
    Arena copy = ArenaManager.convert(arena, arena.getClass());
    copy.setId(ArenaManager.getNextId());
    copy.setName(name);
    copy.setDisplayName(name);
    copy.write();
    send(PREFIX + "Creating arena &e" + name + "&3");
    send(PREFIX + "&cRecommended: &3Edit .yml file to remove locations");
    Minigames.getMenus().openArenaMenu(player(), ArenaManager.get(name));
}
Also used : Arena(gg.projecteden.nexus.features.minigames.models.Arena) Path(gg.projecteden.nexus.framework.commands.models.annotations.Path) Permission(gg.projecteden.nexus.framework.commands.models.annotations.Permission)

Example 92 with Permission

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

the class MinigamesCommand method create.

@Path("create <name>")
@Permission(PERMISSION_MANAGE)
void create(String name) {
    if (ArenaManager.exists(name))
        send(PREFIX + "Editing arena &e" + name + "&3");
    else {
        Arena arena = new Arena(name);
        arena.write();
        send(PREFIX + "Creating arena &e" + name + "&3");
    }
    Minigames.getMenus().openArenaMenu(player(), ArenaManager.get(name));
}
Also used : Arena(gg.projecteden.nexus.features.minigames.models.Arena) Path(gg.projecteden.nexus.framework.commands.models.annotations.Path) Permission(gg.projecteden.nexus.framework.commands.models.annotations.Permission)

Example 93 with Permission

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

the class MinigamesCommand method addTokens.

@Path("tokens add <amount> [user]")
@Permission(Group.SENIOR_STAFF)
void addTokens(int amount, @Arg("self") Nerd nerd) {
    PerkOwnerService service = new PerkOwnerService();
    PerkOwner perkOwner = service.get(nerd);
    perkOwner.setTokens(amount + perkOwner.getTokens());
    service.save(perkOwner);
    String username = nerd.getUuid().equals(player().getUniqueId()) ? "You now have" : (perkOwner.getNickname() + " now has");
    send(PREFIX + username + " " + perkOwner.getTokens() + plural(" token", perkOwner.getTokens()));
}
Also used : PerkOwner(gg.projecteden.nexus.models.perkowner.PerkOwner) PerkOwnerService(gg.projecteden.nexus.models.perkowner.PerkOwnerService) Path(gg.projecteden.nexus.framework.commands.models.annotations.Path) Permission(gg.projecteden.nexus.framework.commands.models.annotations.Permission)

Example 94 with Permission

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

the class MinigamesCommand method setTokens.

@Path("tokens set <amount> [user]")
@Permission(Group.SENIOR_STAFF)
void setTokens(int amount, @Arg("self") Nerd nerd) {
    PerkOwnerService service = new PerkOwnerService();
    PerkOwner perkOwner = service.get(nerd);
    perkOwner.setTokens(amount);
    service.save(perkOwner);
    String username = nerd.getUuid().equals(player().getUniqueId()) ? "Your" : (perkOwner.getNickname() + "'s");
    send(PREFIX + username + " tokens were set to " + amount);
}
Also used : PerkOwner(gg.projecteden.nexus.models.perkowner.PerkOwner) PerkOwnerService(gg.projecteden.nexus.models.perkowner.PerkOwnerService) 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