small fixes and missing author for waterfall

This commit is contained in:
2021-12-24 17:38:42 +01:00
parent 7f6315b6b5
commit 7cb94cce4b
9 changed files with 14 additions and 14 deletions
+1 -1
View File
@@ -6,7 +6,7 @@
<parent>
<groupId>eu.endermite.commandwhitelist</groupId>
<artifactId>CommandWhitelist</artifactId>
<version>2.2.2</version>
<version>2.2.3</version>
</parent>
<artifactId>Common</artifactId>
@@ -17,15 +17,17 @@ public class CommandUtil {
public static List<String> filterSuggestions(String buffer, Collection<String> suggestions, Collection<String> blockedSubCommands) {
if (buffer.startsWith("/"))
buffer = buffer.substring(1);
List<String> suggestionsList = new ArrayList<>(suggestions);
if (suggestions.isEmpty() || blockedSubCommands.isEmpty()) return suggestionsList;
for (String s : blockedSubCommands) {
String slast = getLastArgument(s);
String scommand = cutLastArgument(s);
if (buffer.startsWith(scommand)) {
while (suggestions.contains(slast))
suggestions.remove(slast);
String slast = getLastArgument(s);
while (suggestionsList.contains(slast))
suggestionsList.remove(slast);
}
}
return new ArrayList<>(suggestions);
return suggestionsList;
}
/**