Search in sources :

Example 1 with CheckpointMechanic

use of gg.projecteden.nexus.features.minigames.mechanics.common.CheckpointMechanic in project Nexus by ProjectEdenGG.

the class MinigamesCommand method autoreset.

@Path("autoreset [boolean]")
@Permission(PERMISSION_USE)
void autoreset(Boolean autoreset) {
    Match match = minigamer.getMatch();
    if (!minigamer.isPlaying())
        error("You must be playing a checkpoint game to use that command");
    if (!(match.getMechanic() instanceof CheckpointMechanic))
        error("You are not in a checkpoint game");
    CheckpointMatchData matchData = match.getMatchData();
    matchData.autoreset(minigamer, autoreset);
    if (matchData.isAutoresetting(minigamer))
        send(PREFIX + "Enabled &eAuto Reset");
    else
        send(PREFIX + "Disabled &eAuto Reset");
}
Also used : CheckpointMechanic(gg.projecteden.nexus.features.minigames.mechanics.common.CheckpointMechanic) CheckpointMatchData(gg.projecteden.nexus.features.minigames.models.matchdata.CheckpointMatchData) Match(gg.projecteden.nexus.features.minigames.models.Match) Path(gg.projecteden.nexus.framework.commands.models.annotations.Path) Permission(gg.projecteden.nexus.framework.commands.models.annotations.Permission)

Aggregations

CheckpointMechanic (gg.projecteden.nexus.features.minigames.mechanics.common.CheckpointMechanic)1 Match (gg.projecteden.nexus.features.minigames.models.Match)1 CheckpointMatchData (gg.projecteden.nexus.features.minigames.models.matchdata.CheckpointMatchData)1 Path (gg.projecteden.nexus.framework.commands.models.annotations.Path)1 Permission (gg.projecteden.nexus.framework.commands.models.annotations.Permission)1