Search in sources :

Example 16 with Path

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

the class Pugmas20Command method treeGet.

@Permission(Group.ADMIN)
@Path("tree get")
void treeGet() {
    Material logs = getTargetBlockRequired().getType();
    PugmasTreeType treeType = PugmasTreeType.of(logs);
    if (treeType == null)
        error("Pugmas Tree with logs " + camelCase(logs) + " not found");
    send(PREFIX + "You are looking at a " + camelCase(treeType) + " tree");
}
Also used : PugmasTreeType(gg.projecteden.nexus.features.events.y2020.pugmas20.quests.OrnamentVendor.PugmasTreeType) Material(org.bukkit.Material) Path(gg.projecteden.nexus.framework.commands.models.annotations.Path) Permission(gg.projecteden.nexus.framework.commands.models.annotations.Permission)

Example 17 with Path

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

the class Pugmas20Command method treeCounts.

@Permission(Group.ADMIN)
@Path("tree counts")
void treeCounts() {
    int total = 0;
    JsonBuilder json = json(PREFIX + "Pugmas tree counts:");
    for (PugmasTreeType treeType : PugmasTreeType.values()) {
        Set<Integer> ids = treeType.getPasters().keySet();
        if (ids.size() == 0)
            continue;
        String collect = ids.stream().map(String::valueOf).collect(Collectors.joining(", "));
        json.newline().next("&e " + camelCase(treeType) + " &7- " + ids.size() + " &3[" + collect + "]");
        total += ids.size();
    }
    if (total == 0)
        error("No pugmas trees found");
    send(json.newline().next("&3Total: &e" + total));
}
Also used : JsonBuilder(gg.projecteden.nexus.utils.JsonBuilder) PugmasTreeType(gg.projecteden.nexus.features.events.y2020.pugmas20.quests.OrnamentVendor.PugmasTreeType) Pugmas20.showWaypoint(gg.projecteden.nexus.features.events.y2020.pugmas20.Pugmas20.showWaypoint) Path(gg.projecteden.nexus.framework.commands.models.annotations.Path) Permission(gg.projecteden.nexus.framework.commands.models.annotations.Permission)

Example 18 with Path

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

the class Pugmas20Command method pugmas.

@Path
void pugmas() {
    LocalDate now = LocalDate.now();
    if (isBeforePugmas(now) && !isStaff())
        error("Soon™ (" + timeLeft + ")");
    if (pugmasUser.isWarped()) {
        player().teleportAsync(Pugmas20.getSubsequentSpawn(), TeleportCause.COMMAND);
    } else {
        player().teleportAsync(Pugmas20.getInitialSpawn(), TeleportCause.COMMAND);
        pugmasUser.setWarped(true);
        pugmasService.save(pugmasUser);
    }
}
Also used : LocalDate(java.time.LocalDate) Path(gg.projecteden.nexus.framework.commands.models.annotations.Path)

Example 19 with Path

use of gg.projecteden.nexus.framework.commands.models.annotations.Path 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 20 with Path

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

the class BearFair21StatsCommand method stats.

@Path
void stats() {
    List<BearFair21User> users = userService.getAll();
    EventUserService eventUserService = new EventUserService();
    List<EventUser> eventUsers = eventUserService.getAll();
    // Total time played
    // % of time spent at bf vs other worlds
    // % of people who logged in that visited bf
    // % of playtime per world during bf
    send("&6&lUnique visitors: &e" + users.stream().filter(bearFair21User -> !bearFair21User.isFirstVisit()).count());
    line();
    send("&6&lQuest Stages");
    send(json("- Main").hover(getQuestStages(users, BearFair21UserQuestStageHelper.MAIN)));
    send(json("  - LumberJack").hover(getQuestStages(users, BearFair21UserQuestStageHelper.LUMBERJACK)));
    send(json("  - BeeKeeper").hover(getQuestStages(users, BearFair21UserQuestStageHelper.BEEKEEPER)));
    send(json("  - Recycler").hover(getQuestStages(users, BearFair21UserQuestStageHelper.RECYCLER)));
    send(json("- Minigame Night").hover(getQuestStages(users, BearFair21UserQuestStageHelper.MINIGAME_NIGHT)));
    send(json("- Pugmas").hover(getQuestStages(users, BearFair21UserQuestStageHelper.PUGMAS)));
    send(json("- Halloween").hover(getQuestStages(users, BearFair21UserQuestStageHelper.HALLOWEEN)));
    send(json("- Summer Down Under").hover(getQuestStages(users, BearFair21UserQuestStageHelper.SUMMER_DOWN_UNDER)));
    line();
    send("&6&lEvent Participation");
    for (String event : eventParticipation.keySet()) send(" - " + event + ": " + eventParticipation.get(event).size());
    line();
    send("&6&lDaily Points");
    for (Day day : Day.values()) send(json(" - Day " + (day.ordinal() + 1)).hover(getCompletedSources(eventUsers, day)));
    line();
    send("&6&lTreasure Chests");
    Map<Integer, Integer> data = getTreasureChestData(users);
    send(json("- Found all: " + data.get(20)));
    send(json("- Found some: " + getFoundSomeTreasureChests(data)).hover(getTreasureChestStats(data)));
    send(json("- Found none: " + data.get(0)));
}
Also used : Path(gg.projecteden.nexus.framework.commands.models.annotations.Path) StringUtils(gg.projecteden.nexus.utils.StringUtils) Getter(lombok.Getter) BearFair21(gg.projecteden.nexus.features.events.y2021.bearfair21.BearFair21) CustomCommand(gg.projecteden.nexus.framework.commands.models.CustomCommand) EventUserService(gg.projecteden.nexus.models.eventuser.EventUserService) HashMap(java.util.HashMap) BearFair21User(gg.projecteden.nexus.models.bearfair21.BearFair21User) ArrayList(java.util.ArrayList) Aliases(gg.projecteden.nexus.framework.commands.models.annotations.Aliases) List(java.util.List) BearFair21UserService(gg.projecteden.nexus.models.bearfair21.BearFair21UserService) EventUser(gg.projecteden.nexus.models.eventuser.EventUser) QuestStage(gg.projecteden.nexus.features.events.models.QuestStage) CommandEvent(gg.projecteden.nexus.framework.commands.models.events.CommandEvent) AtomicInteger(java.util.concurrent.atomic.AtomicInteger) BF21PointSource(gg.projecteden.nexus.features.events.y2021.bearfair21.BearFair21.BF21PointSource) BearFair21UserQuestStageHelper(gg.projecteden.nexus.features.events.y2021.bearfair21.commands.BearFair21Command.BearFair21UserQuestStageHelper) LocalDate(java.time.LocalDate) Map(java.util.Map) Utils(gg.projecteden.utils.Utils) AllArgsConstructor(lombok.AllArgsConstructor) NotNull(org.jetbrains.annotations.NotNull) Comparator(java.util.Comparator) AtomicInteger(java.util.concurrent.atomic.AtomicInteger) EventUser(gg.projecteden.nexus.models.eventuser.EventUser) BearFair21User(gg.projecteden.nexus.models.bearfair21.BearFair21User) EventUserService(gg.projecteden.nexus.models.eventuser.EventUserService) 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