Challenges/src/bskyblock/addon/challenges/commands/ChallengesCommand.java
Tastybento 51422108c6 WIP - challenges
Admin command cadmin to create and manage challenges in-game. Challenges
are saved as yml files. Note that admins cannot edit yml files directly
if server is running because they will be overwritten.
User UI sort of works if challenge files are hand tailored.
More to do!
2018-02-22 23:52:39 -08:00

41 lines
1.1 KiB
Java

package bskyblock.addon.challenges.commands;
import java.util.List;
import bskyblock.addon.challenges.Challenges;
import us.tastybento.bskyblock.Constants;
import us.tastybento.bskyblock.api.commands.CompositeCommand;
import us.tastybento.bskyblock.api.commands.User;
public class ChallengesCommand extends CompositeCommand {
private static final String CHALLENGE_COMMAND = "challenges";
private Challenges addon;
public ChallengesCommand(Challenges addon) {
super(CHALLENGE_COMMAND, "c", "challenge");
this.addon = addon;
// Set up commands
}
@Override
public boolean execute(User user, List<String> args) {
// Open up the challenges GUI
if (user.isPlayer()) {
addon.getChallengesManager().getChallengesPanels().getChallenges(user);
return true;
}
return false;
}
@Override
public void setup() {
this.setOnlyPlayer(true);
this.setPermission(Constants.PERMPREFIX + "challenges");
this.setParameters("challaneges.parameters");
this.setDescription("challenges.description");
this.setOnlyPlayer(true);
}
}