mirror of
https://github.com/GeyserMC/Geyser.git
synced 2024-08-14 23:57:35 +00:00
Remove commands from autocomplete/help list that cannot be run (#2602)
* only tabcomplete for commands the sender has permission for * set permission defaults for spigot * Make velocity autocomplete on arg length 0 and 1 * fix advancements perm in spigot plugin.yml and add settings perm (whoops) * don't show bedrock commands to java players * modify spigot perm defaults * censor help menu, abstract tab complete code * Bedrock players don't get cmd argument suggestions * update spigot plugin.yml
This commit is contained in:
parent
c115afba85
commit
f883dfdf2c
14 changed files with 132 additions and 30 deletions
|
@ -63,4 +63,9 @@ public class BungeeCommandSender implements CommandSender {
|
|||
}
|
||||
return LanguageUtils.getDefaultLocale();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasPermission(String permission) {
|
||||
return handle.hasPermission(permission);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -35,8 +35,8 @@ import org.geysermc.connector.command.GeyserCommand;
|
|||
import org.geysermc.connector.network.session.GeyserSession;
|
||||
import org.geysermc.connector.utils.LanguageUtils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
|
||||
public class GeyserBungeeCommandExecutor extends Command implements TabExecutor {
|
||||
|
||||
|
@ -82,8 +82,9 @@ public class GeyserBungeeCommandExecutor extends Command implements TabExecutor
|
|||
@Override
|
||||
public Iterable<String> onTabComplete(CommandSender sender, String[] args) {
|
||||
if (args.length == 1) {
|
||||
return connector.getCommandManager().getCommandNames();
|
||||
return commandExecutor.tabComplete(new BungeeCommandSender(sender));
|
||||
} else {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
return new ArrayList<>();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue