Skip to content
This repository has been archived by the owner on Jul 7, 2023. It is now read-only.

Commit

Permalink
Reverted MCommand because 9ce8467 commit broke it :/
Browse files Browse the repository at this point in the history
  • Loading branch information
prosavage committed Sep 3, 2018
1 parent 262ca66 commit ef2ab6b
Showing 1 changed file with 18 additions and 16 deletions.
34 changes: 18 additions & 16 deletions src/main/java/com/massivecraft/factions/zcore/MCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -99,25 +99,27 @@ public void execute(CommandSender sender, List<String> args, List<MCommand<?>> c
}
this.args = args;
this.commandChain = commandChain;
if (validCall(this.sender, this.args)) {
// This is always true but anyway
if (!this.isEnabled()) {
return;
}
// Is there a matching sub command?
if (args.size() > 0) {
for (MCommand<?> subCommand : this.subCommands) {
if (subCommand.aliases.contains(args.get(0).toLowerCase())) {
args.remove(0);
commandChain.add(this);
subCommand.execute(sender, args, commandChain);
return;
}

// Is there a matching sub command?
if (args.size() > 0) {
for (MCommand<?> subCommand : this.subCommands) {
if (subCommand.aliases.contains(args.get(0).toLowerCase())) {
args.remove(0);
commandChain.add(this);
subCommand.execute(sender, args, commandChain);
return;
}
}
} else {
}

if (!validCall(this.sender, this.args)) {
return;
}

if (!this.isEnabled()) {
return;
}

perform();
}

Expand Down Expand Up @@ -471,4 +473,4 @@ public Player argAsBestPlayerMatch(int idx, Player def) {
public Player argAsBestPlayerMatch(int idx) {
return this.argAsPlayer(idx, null);
}
}
}

0 comments on commit ef2ab6b

Please sign in to comment.