Search in sources :

Example 1 with Description

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

the class Pugmas20Command method district.

@Path("district")
@Description("View which district you are currently in")
void district() {
    District district = District.of(location());
    send(PREFIX + "You are " + (district == District.UNKNOWN ? "not in a district" : "in the &e" + district.getName() + " District"));
}
Also used : District(gg.projecteden.nexus.features.events.y2020.pugmas20.models.AdventChest.District) Path(gg.projecteden.nexus.framework.commands.models.annotations.Path) Description(gg.projecteden.nexus.framework.commands.models.annotations.Description)

Example 2 with Description

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

the class TrustCommand method home.

@Description("Allow specified player(s) to a specific home")
@Path("home <home> <players>")
void home(Home home, @Arg(type = OfflinePlayer.class) List<OfflinePlayer> players) {
    players.forEach(home::allow);
    new HomeService().save(home.getOwner());
    send(PREFIX + "Trusted &e" + nicknames(players, "&3, &e") + " &3to home &e" + home.getName());
}
Also used : HomeService(gg.projecteden.nexus.models.home.HomeService) Path(gg.projecteden.nexus.framework.commands.models.annotations.Path) Description(gg.projecteden.nexus.framework.commands.models.annotations.Description)

Example 3 with Description

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

the class Pugmas21Command method randomizePresents.

@Path("randomizePresents")
@Permission(Group.ADMIN)
@Description("Randomizes the presents in your selection")
void randomizePresents() {
    List<Instrument> instruments = List.of(Instrument.DIDGERIDOO, Instrument.PLING);
    WorldEditUtils WEUtils = new WorldEditUtils(player());
    Region selection = WEUtils.getPlayerSelection(player());
    for (Block block : WEUtils.getBlocks(selection)) {
        if (block.getType() != Material.NOTE_BLOCK)
            continue;
        NoteBlock noteBlock = (NoteBlock) block.getBlockData();
        noteBlock.setInstrument(RandomUtils.randomElement(instruments));
        noteBlock.setNote(new Note(RandomUtils.randomInt(0, 24)));
        block.setBlockData(noteBlock);
    }
}
Also used : NoteBlock(org.bukkit.block.data.type.NoteBlock) WorldEditUtils(gg.projecteden.nexus.utils.WorldEditUtils) Note(org.bukkit.Note) Instrument(org.bukkit.Instrument) Region(com.sk89q.worldedit.regions.Region) Block(org.bukkit.block.Block) NoteBlock(org.bukkit.block.data.type.NoteBlock) 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 4 with Description

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

the class Pugmas21Command method district.

@Path("district")
@Description("View which district you are currently in")
void district() {
    District district = District.of(location());
    if (district == null)
        error("You must be in Pugmas to run this command");
    send(PREFIX + "You are " + (district == District.UNKNOWN ? "not in a district" : "in the &e" + district.getFullName()));
}
Also used : District(gg.projecteden.nexus.features.events.y2021.pugmas21.models.District) Path(gg.projecteden.nexus.framework.commands.models.annotations.Path) Description(gg.projecteden.nexus.framework.commands.models.annotations.Description)

Example 5 with Description

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

the class Pugmas21Command method advent.

@Path("advent")
@Description("Open the advent calender")
void advent(@Arg(value = "0", permission = Group.ADMIN) @Switch int day, @Arg(value = "30", permission = Group.ADMIN) @Switch int frameTicks) {
    verifyDate();
    LocalDate date = Pugmas21.TODAY;
    if (date.isBefore(Pugmas21.EPOCH) || day > 0)
        date = Pugmas21.EPOCH.plusDays(day - 1);
    new AdventMenu(user, date, frameTicks).open(player());
}
Also used : AdventMenu(gg.projecteden.nexus.features.events.y2021.pugmas21.advent.AdventMenu) LocalDate(java.time.LocalDate) Path(gg.projecteden.nexus.framework.commands.models.annotations.Path) Description(gg.projecteden.nexus.framework.commands.models.annotations.Description)

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