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

Commit ef2ab6b

Browse files
committed
Reverted MCommand because 9ce8467 commit broke it :/
1 parent 262ca66 commit ef2ab6b

File tree

1 file changed

+18
-16
lines changed

1 file changed

+18
-16
lines changed

src/main/java/com/massivecraft/factions/zcore/MCommand.java

+18-16
Original file line numberDiff line numberDiff line change
@@ -99,25 +99,27 @@ public void execute(CommandSender sender, List<String> args, List<MCommand<?>> c
9999
}
100100
this.args = args;
101101
this.commandChain = commandChain;
102-
if (validCall(this.sender, this.args)) {
103-
// This is always true but anyway
104-
if (!this.isEnabled()) {
105-
return;
106-
}
107-
// Is there a matching sub command?
108-
if (args.size() > 0) {
109-
for (MCommand<?> subCommand : this.subCommands) {
110-
if (subCommand.aliases.contains(args.get(0).toLowerCase())) {
111-
args.remove(0);
112-
commandChain.add(this);
113-
subCommand.execute(sender, args, commandChain);
114-
return;
115-
}
102+
103+
// Is there a matching sub command?
104+
if (args.size() > 0) {
105+
for (MCommand<?> subCommand : this.subCommands) {
106+
if (subCommand.aliases.contains(args.get(0).toLowerCase())) {
107+
args.remove(0);
108+
commandChain.add(this);
109+
subCommand.execute(sender, args, commandChain);
110+
return;
116111
}
117112
}
118-
} else {
113+
}
114+
115+
if (!validCall(this.sender, this.args)) {
119116
return;
120117
}
118+
119+
if (!this.isEnabled()) {
120+
return;
121+
}
122+
121123
perform();
122124
}
123125

@@ -471,4 +473,4 @@ public Player argAsBestPlayerMatch(int idx, Player def) {
471473
public Player argAsBestPlayerMatch(int idx) {
472474
return this.argAsPlayer(idx, null);
473475
}
474-
}
476+
}

0 commit comments

Comments
 (0)