Search in sources :

Example 11 with Path

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

the class TeleportCommand method disable.

@Path("toggle")
@Permission("ladder.builder")
void disable() {
    SettingService settingService = new SettingService();
    Setting setting = settingService.get(player(), "tpDisable");
    boolean enable = setting.getBoolean();
    setting.setBoolean(!enable);
    settingService.save(setting);
    send(PREFIX + "Teleports to you have been " + (enable ? "&aenabled" : "&cdisabled"));
}
Also used : SettingService(gg.projecteden.nexus.models.setting.SettingService) Setting(gg.projecteden.nexus.models.setting.Setting) Path(gg.projecteden.nexus.framework.commands.models.annotations.Path) Permission(gg.projecteden.nexus.framework.commands.models.annotations.Permission)

Example 12 with Path

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

the class StripLogsCommand method convert.

@Path
void convert() {
    Inventory inv = Bukkit.createInventory(null, 54, TITLE);
    player().openInventory(inv);
}
Also used : Inventory(org.bukkit.inventory.Inventory) Path(gg.projecteden.nexus.framework.commands.models.annotations.Path)

Example 13 with Path

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

the class TreeCommand method run.

@Path("[type]")
void run(@Arg("tree") TreeType treeType) {
    Block target = getTargetBlockRequired();
    Location location = target.getLocation().add(0, 1, 0);
    if (location.getBlock().getType().isSolid())
        error("Could not generate tree on " + camelCase(target.getType()));
    if (world().generateTree(target.getLocation(), treeType))
        send(PREFIX + "Generated " + camelCase(treeType));
    else
        send(PREFIX + "Tree generation failed");
}
Also used : Block(org.bukkit.block.Block) Location(org.bukkit.Location) Path(gg.projecteden.nexus.framework.commands.models.annotations.Path)

Example 14 with Path

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

the class UUIDSearchCommand method search.

@Path("<uuid> [amount]")
void search(String search, @Arg("25") int limit) {
    if (search.length() < 4)
        error("Please be more specific!");
    // List<Nerd> nerds = service.find(search, "uuid").stream().limit(limit).collect(Collectors.toList());
    List<Nerd> nerds = new ArrayList<>();
    if (nerds.size() == 0)
        error("No matches found for &e" + search);
    send("&3Matches for '&e" + search + "&3' (&e" + nerds.size() + "&3):");
    for (Nerd nerd : nerds) send(json("&e" + nerd.getUuid() + " (" + nerd.getName() + ")").insert(nerd.getUuid().toString()));
    send("&3Shift+Click on a name to insert it into your chat");
}
Also used : ArrayList(java.util.ArrayList) Nerd(gg.projecteden.nexus.models.nerd.Nerd) Path(gg.projecteden.nexus.framework.commands.models.annotations.Path)

Example 15 with Path

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

the class Pride20Command method leaveParade.

@Path("parade leave [player]")
void leaveParade(@Arg(value = "self", permission = Group.STAFF) OfflinePlayer player) {
    boolean isSelf = isSelf(player);
    String playerText = isSelf ? "You have" : Nickname.of(player) + " has";
    Setting setting = service.get(player, "pride20Parade");
    if (!setting.getBoolean())
        error(playerText + " not joined the parade");
    WorldGuardUtils worldguard = new WorldGuardUtils(Bukkit.getWorld("safepvp"));
    for (Entity entity : worldguard.getEntitiesInRegion("pride20_parade")) {
        if (!entity.hasMetadata("NPC"))
            continue;
        if (entity.getName().equalsIgnoreCase(player.getName()))
            CitizensAPI.getNPCRegistry().getNPC(entity).destroy();
    }
    setting.setBoolean(false);
    service.save(setting);
    send(PREFIX + playerText + " left the pride parade");
}
Also used : Entity(org.bukkit.entity.Entity) Setting(gg.projecteden.nexus.models.setting.Setting) WorldGuardUtils(gg.projecteden.nexus.utils.WorldGuardUtils) Path(gg.projecteden.nexus.framework.commands.models.annotations.Path)

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