Search in sources :

Example 6 with Permission

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

the class Easter20Command method set.

@Permission(Group.STAFF)
@Path("set <player>")
void set(OfflinePlayer player) {
    Sign sign = getTargetSignRequired();
    sign.setLine(0, header);
    sign.setLine(1, player.getName());
    sign.update();
}
Also used : Sign(org.bukkit.block.Sign) Path(gg.projecteden.nexus.framework.commands.models.annotations.Path) Permission(gg.projecteden.nexus.framework.commands.models.annotations.Permission)

Example 7 with Permission

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

the class Halloween20Command method reset.

@Path("reset [player]")
@Permission(Group.ADMIN)
void reset(@Arg("self") OfflinePlayer player) {
    Halloween20Service service = new Halloween20Service();
    Halloween20User user = service.get(player);
    user.setLostPumpkinsStage(QuestStage.LostPumpkins.NOT_STARTED);
    user.setFoundPumpkins(new ArrayList<>());
    user.setCombinationStage(QuestStage.Combination.NOT_STARTED);
    user.setFoundComboLockNumbers(new ArrayList<>());
    service.save(user);
}
Also used : Halloween20User(gg.projecteden.nexus.models.halloween20.Halloween20User) Halloween20Service(gg.projecteden.nexus.models.halloween20.Halloween20Service) Path(gg.projecteden.nexus.framework.commands.models.annotations.Path) Permission(gg.projecteden.nexus.framework.commands.models.annotations.Permission)

Example 8 with Permission

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

the class ParticlesCommand method dot.

@Path("dot")
@Permission(Group.ADMIN)
void dot() {
    Location loc = getCenteredLocation(location()).add(0, 1, 0);
    DotEffect.builder().player(player()).location(loc).ticks(10 * 20).rainbow(true).start();
}
Also used : LocationUtils.getCenteredLocation(gg.projecteden.nexus.utils.LocationUtils.getCenteredLocation) Location(org.bukkit.Location) Path(gg.projecteden.nexus.framework.commands.models.annotations.Path) Permission(gg.projecteden.nexus.framework.commands.models.annotations.Permission)

Example 9 with Permission

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

the class BannerCommand method all.

@Permission("nexus.banners")
@Path("<baseColor> <patternColor> [input...]")
void all(DyeColor baseColor, DyeColor patternColor, @Arg("*") String input) {
    ItemBuilder baseBanner = new ItemBuilder(ColorType.of(baseColor).getBanner());
    if (input.equalsIgnoreCase("*")) {
        // All Banners
        for (SymbolBanner.Symbol symbol : SymbolBanner.Symbol.values()) {
            ItemBuilder banner = symbol.get(baseBanner.clone(), baseColor, patternColor);
            if (banner != null)
                PlayerUtils.giveItem(player(), banner.build());
        }
    } else {
        // Input Banners
        char[] chars = input.toUpperCase().replaceAll(" ", "").toCharArray();
        for (int i = 0; i < chars.length; i++) {
            char character = input.charAt(i);
            Symbol symbol = Symbol.of(character);
            if (symbol == null)
                continue;
            ItemBuilder banner = symbol.get(baseBanner.clone(), baseColor, patternColor);
            if (banner != null)
                PlayerUtils.giveItem(player(), banner.build());
        }
    }
}
Also used : ItemBuilder(gg.projecteden.nexus.utils.ItemBuilder) SymbolBanner(gg.projecteden.nexus.utils.SymbolBanner) Symbol(gg.projecteden.nexus.utils.SymbolBanner.Symbol) Symbol(gg.projecteden.nexus.utils.SymbolBanner.Symbol) Path(gg.projecteden.nexus.framework.commands.models.annotations.Path) Permission(gg.projecteden.nexus.framework.commands.models.annotations.Permission)

Example 10 with Permission

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

the class BoostsCommand method start.

@Confirm
@Permission(Group.SENIOR_STAFF)
@Path("start <type> <multiplier> <duration>")
void start(Boostable type, double multiplier, int duration) {
    if (config.hasBoost(type))
        cancel(type, true);
    Booster booster = service.get(Dev.KODA.getUuid());
    Boost boost = booster.add(type, multiplier, duration);
    boost.activate();
    service.save(booster);
    send(PREFIX + "Started a server " + boost.getMultiplierFormatted() + " " + camelCase(type) + " boost for " + Timespan.ofSeconds(boost.getDuration()).format(FormatType.LONG));
}
Also used : Boost(gg.projecteden.nexus.models.boost.Booster.Boost) Booster(gg.projecteden.nexus.models.boost.Booster) Path(gg.projecteden.nexus.framework.commands.models.annotations.Path) Permission(gg.projecteden.nexus.framework.commands.models.annotations.Permission) Confirm(gg.projecteden.nexus.framework.commands.models.annotations.Confirm)

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