Temporary Fix to command autocomplete spam.

This commit is contained in:
ProSavage 2018-12-21 12:13:51 -06:00
parent f2b5b8ccb5
commit 8bf62ca659
7 changed files with 14 additions and 8 deletions

View File

@ -1 +1 @@
3b1334c41e3a7fab70a4b9dedf3d2d6a
fb34817f516246a314b3587e1e3ef368

View File

@ -1 +1 @@
9f456511cf3dddd2d238d9f12e3ebc0dc00e02f8
5eed96da160209b291ea2f058c68a38b47673780

View File

@ -3,10 +3,11 @@
<groupId>com.massivecraft</groupId>
<artifactId>Factions</artifactId>
<versioning>
<release>1.6.9.5-U0.2.1-RC-1.5-BETA</release>
<release>1.6.9.5-U0.2.1-RC-1.5-BETA-2</release>
<versions>
<version>1.6.9.5-U0.2.1-RC-1.5-BETA</version>
<version>1.6.9.5-U0.2.1-RC-1.5-BETA-2</version>
</versions>
<lastUpdated>20181220220357</lastUpdated>
<lastUpdated>20181221181311</lastUpdated>
</versioning>
</metadata>

View File

@ -1 +1 @@
2446c2ce3e973dde08e0d246410e2cd0
9bdc33366d81ebbb51cec5b2a0092585

View File

@ -1 +1 @@
fc6e25aaeb2ec2b3581075cd2bfc657ada82045d
cdb7b8ec048405faa43f32d2daf226382f5952d2

View File

@ -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;