mirror of
https://github.com/TotalFreedomMC/TF-PlotSquared.git
synced 2025-02-12 03:59:22 +00:00
Only show relevant commands
This commit is contained in:
parent
57f18eeb93
commit
fc72197f86
1 changed files with 5 additions and 3 deletions
|
@ -65,9 +65,11 @@ public class MainCommand implements CommandExecutor, TabCompleter {
|
||||||
public static List<SubCommand> getCommands(final SubCommand.CommandCategory category, final Player player) {
|
public static List<SubCommand> getCommands(final SubCommand.CommandCategory category, final Player player) {
|
||||||
final List<SubCommand> cmds = new ArrayList<>();
|
final List<SubCommand> cmds = new ArrayList<>();
|
||||||
for (final SubCommand c : subCommands) {
|
for (final SubCommand c : subCommands) {
|
||||||
if ((c.category.equals(category)) && c.permission.hasPermission(player)) {
|
if (!c.isPlayer || player != null) {
|
||||||
cmds.add(c);
|
if ((c.category.equals(category)) && c.permission.hasPermission(player)) {
|
||||||
}
|
cmds.add(c);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return cmds;
|
return cmds;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue