Temporary Fix to command autocomplete spam.
This commit is contained in:
@@ -506,7 +506,12 @@ public class SavageFactions extends MPlugin {
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> onTabComplete(CommandSender sender, Command command, String alias, String[] args){
|
||||
public List<String> onTabComplete(CommandSender sender, Command command, String alias, String[] args) {
|
||||
FPlayer fPlayer = FPlayers.getInstance().getByPlayer((Player) sender);
|
||||
if (!fPlayer.hasFaction()) {
|
||||
fPlayer.msg("Autocomplete is not available if you do not have a faction.");
|
||||
return new ArrayList<String>();
|
||||
}
|
||||
List<String> completions = new ArrayList<>();
|
||||
String cmd = Conf.baseCommandAliases.isEmpty() ? "/f" : "/" + Conf.baseCommandAliases.get(0);
|
||||
List<String> argsList = new ArrayList<>(Arrays.asList(args));
|
||||
@@ -521,7 +526,7 @@ public class SavageFactions extends MPlugin {
|
||||
MCommand<?> commandFounded = commandsList.stream()
|
||||
.filter(c -> c.aliases.contains(cmdName))
|
||||
.findFirst().orElse(null);
|
||||
|
||||
|
||||
if (commandFounded != null)
|
||||
{
|
||||
commandEx = commandFounded;
|
||||
|
||||
Reference in New Issue
Block a user