Skip to content

Commit

Permalink
small fixes and missing author for waterfall
Browse files Browse the repository at this point in the history
  • Loading branch information
YouHaveTrouble committed Dec 24, 2021
1 parent 7f6315b commit 7cb94cc
Show file tree
Hide file tree
Showing 9 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion CommandWhitelistBukkit/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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>Bukkit</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion CommandWhitelistCommon/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

/**
Expand Down
2 changes: 1 addition & 1 deletion CommandWhitelistVelocity/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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>Velocity</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion CommandWhitelistWaterfall/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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>Waterfall</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,13 @@ public class BungeeTabcompleteListener implements Listener {
public void onTabcomplete(net.md_5.bungee.api.event.TabCompleteEvent event) {
if (!(event.getReceiver() instanceof ProxiedPlayer)) return;
ProxiedPlayer player = (ProxiedPlayer) event.getReceiver();
if (event.getSuggestions().isEmpty()) return;
if (player.hasPermission(CWPermission.BYPASS.permission())) return;

CommandUtil.filterSuggestions(
event.getCursor(),
event.getSuggestions(),
CommandWhitelistWaterfall.getSuggestions(player)
);


}

}
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ public class WaterfallDefineCommandsListener implements Listener {
public void onProxyDefineCommandsEvent(io.github.waterfallmc.waterfall.event.ProxyDefineCommandsEvent event) {
if (event.getReceiver() instanceof ProxiedPlayer) {
ProxiedPlayer player = (ProxiedPlayer) event.getReceiver();
if (player.hasPermission(CWPermission.BYPASS.permission()))
return;
if (player.hasPermission(CWPermission.BYPASS.permission())) return;
HashMap<String, Command> commandHashMap = new HashMap<>();
CommandWhitelistWaterfall.getCommands(player).forEach(cmdName ->
CommandWhitelistWaterfall.getPlugin().getProxy().getPluginManager().getCommands()
Expand Down
1 change: 1 addition & 0 deletions CommandWhitelistWaterfall/src/main/resources/bungee.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
name: CommandWhitelist
author: YouHaveTrouble
version: ${project.version}
main: eu.endermite.commandwhitelist.waterfall.CommandWhitelistWaterfall
description: You decide what commands players can use or tab complete on your server!
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>eu.endermite.commandwhitelist</groupId>
<artifactId>CommandWhitelist</artifactId>
<version>2.2.2</version>
<version>2.2.3</version>
<modules>
<module>CommandWhitelistCommon</module>
<module>CommandWhitelistBukkit</module>
Expand Down

0 comments on commit 7cb94cc

Please sign in to comment.