Compare commits

..

2 Commits

Author SHA1 Message Date
Auxilor
d7fce6834c Updated to 6.35.3 2022-05-03 13:05:41 +01:00
Auxilor
ac807a991b Players can no longer tab-complete commands they don't have permission for 2022-05-03 13:05:32 +01:00
2 changed files with 9 additions and 2 deletions

View File

@@ -167,7 +167,10 @@ abstract class HandledCommand implements CommandBase {
StringUtil.copyPartialMatches(
args[0],
this.getSubcommands().stream().map(CommandBase::getName).collect(Collectors.toList()),
this.getSubcommands().stream()
.filter(subCommand -> sender.hasPermission(subCommand.getPermission()))
.map(CommandBase::getName)
.collect(Collectors.toList()),
completions
);
@@ -182,6 +185,10 @@ abstract class HandledCommand implements CommandBase {
HandledCommand command = null;
for (CommandBase subcommand : this.getSubcommands()) {
if (!sender.hasPermission(subcommand.getPermission())) {
continue;
}
if (args[0].equalsIgnoreCase(subcommand.getName())) {
command = (HandledCommand) subcommand;
}

View File

@@ -1,3 +1,3 @@
version = 6.35.2
version = 6.35.3
plugin-name = eco
kotlin.code.style = official