Search in sources :

Example 6 with Description

use of gg.projecteden.nexus.framework.commands.models.annotations.Description 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("");
}
Also used : ItemStack(org.bukkit.inventory.ItemStack) Path(gg.projecteden.nexus.framework.commands.models.annotations.Path) Description(gg.projecteden.nexus.framework.commands.models.annotations.Description) Permission(gg.projecteden.nexus.framework.commands.models.annotations.Permission)

Example 7 with Description

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

the class ItemTagsCommand method update.

@Path("update [debug]")
@Permission(Group.ADMIN)
@Description("Update item tags on held item")
void update(@Arg("false") Boolean bool) {
    ItemStack tool = getToolRequired();
    Player debugger = bool ? player() : null;
    ItemTagsUtils.updateItem(tool, debugger);
}
Also used : Player(org.bukkit.entity.Player) ItemStack(org.bukkit.inventory.ItemStack) Path(gg.projecteden.nexus.framework.commands.models.annotations.Path) Description(gg.projecteden.nexus.framework.commands.models.annotations.Description) Permission(gg.projecteden.nexus.framework.commands.models.annotations.Permission)

Example 8 with Description

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

the class RadioCommand method leaveRadio.

@Path("leave")
@Description("Leave the listened radio")
void leaveRadio() {
    Radio radio = getListenedRadio(player(), true);
    if (radio == null)
        return;
    removePlayer(player(), radio);
    if (radio.getType().equals(RadioType.RADIUS))
        user.getLeftRadiusRadios().add(radio.getId());
    else
        user.setLastServerRadioId(null);
    if (user.getLastServerRadio() != null)
        addPlayer(player(), user.getLastServerRadio());
    userService.save(user);
}
Also used : Radio(gg.projecteden.nexus.models.radio.RadioConfig.Radio) RadioUtils.getListenedRadio(gg.projecteden.nexus.features.radio.RadioUtils.getListenedRadio) RadioUtils.isInRangeOfRadiusRadio(gg.projecteden.nexus.features.radio.RadioUtils.isInRangeOfRadiusRadio) Path(gg.projecteden.nexus.framework.commands.models.annotations.Path) Description(gg.projecteden.nexus.framework.commands.models.annotations.Description)

Example 9 with Description

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

the class ScoreboardCommand method book.

@Description("Control which lines you want to see")
@Path("edit")
void book() {
    WrittenBookMenu builder = new WrittenBookMenu();
    int index = 0;
    JsonBuilder json = new JsonBuilder();
    for (ScoreboardLine line : ScoreboardLine.values()) {
        if (!line.isOptional())
            continue;
        if (!line.hasPermission(player()) && !user.getLines().containsKey(line))
            continue;
        json.next((user.getLines().containsKey(line) && user.getLines().get(line)) ? "&a✔" : "&c✗").command("/scoreboard edit toggle " + line.name().toLowerCase()).hover("&eClick to toggle").next(" ").group();
        json.next("&3" + camelCase(line)).hover(line.render(player()));
        json.newline().group();
        if (++index % 14 == 0) {
            builder.addPage(json);
            json = new JsonBuilder();
        }
    }
    builder.addPage(json).open(player());
}
Also used : JsonBuilder(gg.projecteden.nexus.utils.JsonBuilder) WrittenBookMenu(gg.projecteden.nexus.features.menus.BookBuilder.WrittenBookMenu) Path(gg.projecteden.nexus.framework.commands.models.annotations.Path) Description(gg.projecteden.nexus.framework.commands.models.annotations.Description)

Example 10 with Description

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

the class ItemTagsCommand method updateInv.

@Path("updateInv")
@Permission(Group.ADMIN)
@Description("Update item tags on all items in inventory")
void updateInv() {
    ItemStack[] contents = inventory().getContents();
    int count = 0;
    for (ItemStack item : contents) {
        if (isNullOrAir(item))
            continue;
        ItemTagsUtils.updateItem(item);
        ++count;
    }
    send(PREFIX + count + " items itemtags updated!");
}
Also used : ItemStack(org.bukkit.inventory.ItemStack) Path(gg.projecteden.nexus.framework.commands.models.annotations.Path) Description(gg.projecteden.nexus.framework.commands.models.annotations.Description) Permission(gg.projecteden.nexus.framework.commands.models.annotations.Permission)

Aggregations

Description (gg.projecteden.nexus.framework.commands.models.annotations.Description)22 Path (gg.projecteden.nexus.framework.commands.models.annotations.Path)21 Permission (gg.projecteden.nexus.framework.commands.models.annotations.Permission)7 LocalDate (java.time.LocalDate)5 JsonBuilder (gg.projecteden.nexus.utils.JsonBuilder)4 ItemStack (org.bukkit.inventory.ItemStack)4 RadioUtils.getListenedRadio (gg.projecteden.nexus.features.radio.RadioUtils.getListenedRadio)3 RadioUtils.isInRangeOfRadiusRadio (gg.projecteden.nexus.features.radio.RadioUtils.isInRangeOfRadiusRadio)3 Radio (gg.projecteden.nexus.models.radio.RadioConfig.Radio)3 Player (org.bukkit.entity.Player)3 AdventChest (gg.projecteden.nexus.features.events.y2020.pugmas20.models.AdventChest)2 ConverterFor (gg.projecteden.nexus.framework.commands.models.annotations.ConverterFor)2 Switch (gg.projecteden.nexus.framework.commands.models.annotations.Switch)2 TabCompleterFor (gg.projecteden.nexus.framework.commands.models.annotations.TabCompleterFor)2 CommandEvent (gg.projecteden.nexus.framework.commands.models.events.CommandEvent)2 Nerd (gg.projecteden.nexus.models.nerd.Nerd)2 Rank (gg.projecteden.nexus.models.nerd.Rank)2 Nickname (gg.projecteden.nexus.models.nickname.Nickname)2 RadioSong (gg.projecteden.nexus.models.radio.RadioConfig.RadioSong)2 PlayerUtils (gg.projecteden.nexus.utils.PlayerUtils)2