Search in sources :

Example 6 with Path

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

the class BuildContestCommand method item.

@Path("setup item <theme...>")
@Permission(Group.ADMIN)
void item(String theme) {
    ItemStack item = getToolRequired();
    item.setAmount(1);
    ItemBuilder.setName(item, "&6&lBuild Contest");
    ItemBuilder.addLore(item, "&e&lJoin our latest build contest!");
    ItemBuilder.addLore(item, "&e&lTheme: &6&l" + theme);
    buildContest.setItemStack(item);
    buildContest.setTheme(theme);
    save();
    send(PREFIX + "Saved the item to the item in your hand");
}
Also used : ItemStack(org.bukkit.inventory.ItemStack) Path(gg.projecteden.nexus.framework.commands.models.annotations.Path) Permission(gg.projecteden.nexus.framework.commands.models.annotations.Permission)

Example 7 with Path

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

the class BuildContestCommand method buildcontest.

@Path
void buildcontest() {
    if (!buildContest.isActive())
        error("There are no active build contests running");
    Warp warp = WarpType.NORMAL.get("buildcontest" + buildContest.getId());
    if (warp == null)
        error("That warp is not set.");
    warp.teleportAsync(player());
    send(PREFIX + "Warping to build contest &e" + buildContest.getTheme());
}
Also used : Warp(gg.projecteden.nexus.models.warps.Warps.Warp) Path(gg.projecteden.nexus.framework.commands.models.annotations.Path)

Example 8 with Path

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

the class InviteRewardsCommand method send.

@Path("<username>")
void send(Player invited) {
    Player inviter = player();
    if (inviter.equals(invited))
        error(colorize("You cannot invite yourself!"));
    if (Nerd.of(inviter).getFirstJoin().isAfter(Nerd.of(invited).getFirstJoin()))
        error("You joined after &e" + invited.getName() + "&c, so you can't have invited them!");
    if (hasBeenInvitedBefore(invited))
        error("&e" + invited.getName() + "&c has already confirmed being invited by someone else");
    if (!invited.hasPermission("invite.rewards.confirm"))
        error("The person you are inviting must be a &fMember &cor above.");
    if (getMinutesPlayed(invited) < 60)
        error("&e" + invited.getName() + "&c has to play for an hour before you can do that.");
    sendInviteConfirmation(inviter, invited);
}
Also used : Player(org.bukkit.entity.Player) Path(gg.projecteden.nexus.framework.commands.models.annotations.Path)

Example 9 with Path

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

the class InviteRewardsCommand method confirm.

@HideFromHelp
@TabCompleteIgnore
@Path("confirm <inviter>")
void confirm(Player inviter) {
    Player invited = player();
    if (Nerd.of(inviter).getFirstJoin().isAfter(Nerd.of(invited).getFirstJoin()))
        error("&e" + inviter.getName() + " &cjoined after you, so you can't have been invited by them!");
    if (hasBeenInvitedBefore(invited))
        error("&cYou have already confirmed being invited by someone else");
    if (getMinutesPlayed(invited) < 60)
        error("You have to play for an hour before you can do that.");
    send(inviter, PREFIX + "&e" + invited.getName() + "&3 has confirmed your invite; thank you for " + "helping Project Eden grow! You earned &e15 vote points");
    send(invited, PREFIX + "You have confirmed &e" + inviter.getName() + "'s &3invite. Thank you " + "for flying Project Eden!");
    reward(inviter);
    saveInvitation(inviter, invited);
}
Also used : Player(org.bukkit.entity.Player) Path(gg.projecteden.nexus.framework.commands.models.annotations.Path) HideFromHelp(gg.projecteden.nexus.framework.commands.models.annotations.HideFromHelp) TabCompleteIgnore(gg.projecteden.nexus.framework.commands.models.annotations.TabCompleteIgnore)

Example 10 with Path

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

the class MailCommand method cancel.

@TabCompleteIgnore
@HideFromHelp
@Path("cancel")
void cancel() {
    Mail mail = from.getPending();
    mail.cancel();
    save(from);
    send(PREFIX + "Mail to " + mail.getNickname() + " cancelled");
}
Also used : Mail(gg.projecteden.nexus.models.mail.Mailer.Mail) Path(gg.projecteden.nexus.framework.commands.models.annotations.Path) HideFromHelp(gg.projecteden.nexus.framework.commands.models.annotations.HideFromHelp) TabCompleteIgnore(gg.projecteden.nexus.framework.commands.models.annotations.TabCompleteIgnore)

Aggregations

Path (gg.projecteden.nexus.framework.commands.models.annotations.Path)333 Permission (gg.projecteden.nexus.framework.commands.models.annotations.Permission)110 JsonBuilder (gg.projecteden.nexus.utils.JsonBuilder)51 Async (gg.projecteden.annotations.Async)48 ItemStack (org.bukkit.inventory.ItemStack)38 CommandEvent (gg.projecteden.nexus.framework.commands.models.events.CommandEvent)31 ArrayList (java.util.ArrayList)31 CustomCommand (gg.projecteden.nexus.framework.commands.models.CustomCommand)30 Description (gg.projecteden.nexus.framework.commands.models.annotations.Description)29 List (java.util.List)28 Location (org.bukkit.Location)28 Group (gg.projecteden.nexus.framework.commands.models.annotations.Permission.Group)27 UUID (java.util.UUID)26 Arg (gg.projecteden.nexus.framework.commands.models.annotations.Arg)25 Nerd (gg.projecteden.nexus.models.nerd.Nerd)24 HashMap (java.util.HashMap)24 BiFunction (java.util.function.BiFunction)21 Map (java.util.Map)20 Player (org.bukkit.entity.Player)20 NonNull (lombok.NonNull)18