mirror of
https://github.com/YouHaveTrouble/CommandWhitelist.git
synced 2026-05-11 22:16:57 +00:00
small fixes and missing author for waterfall
This commit is contained in:
@@ -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>
|
||||
|
||||
+6
-4
@@ -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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user