Search in sources :

Example 16 with Permission

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

the class EndermanFarmCommand method create.

@Path("create [player]")
@Permission(Group.SENIOR_STAFF)
void create(OfflinePlayer player) {
    if (world().getEnvironment() != Environment.THE_END)
        error("You must be in the end to run this command");
    final Region selection = worldedit.getPlayerSelection(player());
    if (selection == null)
        error("You have not selected the farm");
    final String regionId = getRegionId(player.getUniqueId());
    runMultiCommand("rg define " + regionId, "rg flag " + regionId + " passthrough allow");
}
Also used : ProtectedRegion(com.sk89q.worldguard.protection.regions.ProtectedRegion) Region(com.sk89q.worldedit.regions.Region) Path(gg.projecteden.nexus.framework.commands.models.annotations.Path) Permission(gg.projecteden.nexus.framework.commands.models.annotations.Permission)

Example 17 with Permission

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

the class FirstLoginCommand method stats.

@Async
@Path("stats")
@Permission(Group.ADMIN)
void stats() {
    StringBuilder data = new StringBuilder();
    for (Nerd nerd : new NerdService().getAll()) if (nerd.getFirstJoin() != null)
        data.append(nerd.getNickname()).append(",").append(DateTimeFormatter.ISO_LOCAL_DATE_TIME.format(nerd.getFirstJoin())).append(System.lineSeparator());
    IOUtils.fileAppend("joindates.csv", data.toString());
    send(PREFIX + "Generated joindates.csv");
}
Also used : Nerd(gg.projecteden.nexus.models.nerd.Nerd) NerdService(gg.projecteden.nexus.models.nerd.NerdService) Path(gg.projecteden.nexus.framework.commands.models.annotations.Path) Async(gg.projecteden.annotations.Async) Permission(gg.projecteden.nexus.framework.commands.models.annotations.Permission)

Example 18 with Permission

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

the class ArmorStandEditorCommand method set_arms_left.

@Path("set arms left <x> <y> <z>")
@Permission(Group.ADMIN)
void set_arms_left(float x, float y, float z) {
    position_arms();
    ArmorStand armorStand = (ArmorStand) getTargetEntityRequired(EntityType.ARMOR_STAND);
    if (!isPerkAllowedAt(player(), armorStand.getLocation()))
        error("You cannot edit armor stands here");
    EulerAngle ea = new EulerAngle(Math.toRadians(x), Math.toRadians(y), Math.toRadians(z));
    armorStand.setLeftArmPose(ea);
}
Also used : ArmorStand(org.bukkit.entity.ArmorStand) EulerAngle(org.bukkit.util.EulerAngle) Path(gg.projecteden.nexus.framework.commands.models.annotations.Path) Permission(gg.projecteden.nexus.framework.commands.models.annotations.Permission)

Example 19 with Permission

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

the class AssetCompetitionCommand method list.

@Path("list")
@Permission(Group.STAFF)
void list() {
    List<AssetCompetition> all = service.getAll();
    if (all.size() == 0)
        error("There are no available submissions");
    JsonBuilder builder = new JsonBuilder();
    for (AssetCompetition assetCompetition : all) {
        if (!builder.isInitialized())
            builder.initialize();
        else
            builder.next("&e, ").group();
        builder.next("&3" + assetCompetition.getName()).command(getAliasUsed() + " tp " + assetCompetition.getName()).group();
    }
    line();
    send(PREFIX + "&3List of submissions &e(Click to teleport)");
    send(builder);
}
Also used : JsonBuilder(gg.projecteden.nexus.utils.JsonBuilder) AssetCompetition(gg.projecteden.nexus.models.assetcompetition.AssetCompetition) Path(gg.projecteden.nexus.framework.commands.models.annotations.Path) Permission(gg.projecteden.nexus.framework.commands.models.annotations.Permission)

Example 20 with Permission

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

the class BadgeCommand method convert.

@Async
@Permission(Group.ADMIN)
@Path("convert")
void convert() {
    int i = 0;
    int owned = 0;
    int active = 0;
    final List<Nerd> nerds = new NerdService().getAll();
    send(PREFIX + "Converting checkmarks");
    for (Nerd nerd : nerds) {
        if (!LuckPermsUtils.hasPermission(nerd, "donated"))
            continue;
        final BadgeUser user = service.get(nerd);
        user.give(Badge.SUPPORTER);
        ++owned;
        if (nerd.isCheckmark()) {
            user.setActive(Badge.SUPPORTER);
            ++active;
        }
        if (++i % 25 == 0)
            send(PREFIX + "Converted &e" + i + "&3/&e" + nerds.size());
    }
    service.saveCache();
    send(PREFIX + "Completed; &e" + owned + " &3owned, &e" + active + " &3active");
}
Also used : Nerd(gg.projecteden.nexus.models.nerd.Nerd) BadgeUser(gg.projecteden.nexus.models.badge.BadgeUser) NerdService(gg.projecteden.nexus.models.nerd.NerdService) Path(gg.projecteden.nexus.framework.commands.models.annotations.Path) Async(gg.projecteden.annotations.Async) 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