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>
|
<parent>
|
||||||
<groupId>eu.endermite.commandwhitelist</groupId>
|
<groupId>eu.endermite.commandwhitelist</groupId>
|
||||||
<artifactId>CommandWhitelist</artifactId>
|
<artifactId>CommandWhitelist</artifactId>
|
||||||
<version>2.2.2</version>
|
<version>2.2.3</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<artifactId>Bukkit</artifactId>
|
<artifactId>Bukkit</artifactId>
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>eu.endermite.commandwhitelist</groupId>
|
<groupId>eu.endermite.commandwhitelist</groupId>
|
||||||
<artifactId>CommandWhitelist</artifactId>
|
<artifactId>CommandWhitelist</artifactId>
|
||||||
<version>2.2.2</version>
|
<version>2.2.3</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<artifactId>Common</artifactId>
|
<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) {
|
public static List<String> filterSuggestions(String buffer, Collection<String> suggestions, Collection<String> blockedSubCommands) {
|
||||||
if (buffer.startsWith("/"))
|
if (buffer.startsWith("/"))
|
||||||
buffer = buffer.substring(1);
|
buffer = buffer.substring(1);
|
||||||
|
List<String> suggestionsList = new ArrayList<>(suggestions);
|
||||||
|
if (suggestions.isEmpty() || blockedSubCommands.isEmpty()) return suggestionsList;
|
||||||
for (String s : blockedSubCommands) {
|
for (String s : blockedSubCommands) {
|
||||||
String slast = getLastArgument(s);
|
|
||||||
String scommand = cutLastArgument(s);
|
String scommand = cutLastArgument(s);
|
||||||
if (buffer.startsWith(scommand)) {
|
if (buffer.startsWith(scommand)) {
|
||||||
while (suggestions.contains(slast))
|
String slast = getLastArgument(s);
|
||||||
suggestions.remove(slast);
|
while (suggestionsList.contains(slast))
|
||||||
|
suggestionsList.remove(slast);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return new ArrayList<>(suggestions);
|
return suggestionsList;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>eu.endermite.commandwhitelist</groupId>
|
<groupId>eu.endermite.commandwhitelist</groupId>
|
||||||
<artifactId>CommandWhitelist</artifactId>
|
<artifactId>CommandWhitelist</artifactId>
|
||||||
<version>2.2.2</version>
|
<version>2.2.3</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<artifactId>Velocity</artifactId>
|
<artifactId>Velocity</artifactId>
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>eu.endermite.commandwhitelist</groupId>
|
<groupId>eu.endermite.commandwhitelist</groupId>
|
||||||
<artifactId>CommandWhitelist</artifactId>
|
<artifactId>CommandWhitelist</artifactId>
|
||||||
<version>2.2.2</version>
|
<version>2.2.3</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<artifactId>Waterfall</artifactId>
|
<artifactId>Waterfall</artifactId>
|
||||||
|
|||||||
+1
-3
@@ -13,15 +13,13 @@ public class BungeeTabcompleteListener implements Listener {
|
|||||||
public void onTabcomplete(net.md_5.bungee.api.event.TabCompleteEvent event) {
|
public void onTabcomplete(net.md_5.bungee.api.event.TabCompleteEvent event) {
|
||||||
if (!(event.getReceiver() instanceof ProxiedPlayer)) return;
|
if (!(event.getReceiver() instanceof ProxiedPlayer)) return;
|
||||||
ProxiedPlayer player = (ProxiedPlayer) event.getReceiver();
|
ProxiedPlayer player = (ProxiedPlayer) event.getReceiver();
|
||||||
|
if (event.getSuggestions().isEmpty()) return;
|
||||||
if (player.hasPermission(CWPermission.BYPASS.permission())) return;
|
if (player.hasPermission(CWPermission.BYPASS.permission())) return;
|
||||||
|
|
||||||
CommandUtil.filterSuggestions(
|
CommandUtil.filterSuggestions(
|
||||||
event.getCursor(),
|
event.getCursor(),
|
||||||
event.getSuggestions(),
|
event.getSuggestions(),
|
||||||
CommandWhitelistWaterfall.getSuggestions(player)
|
CommandWhitelistWaterfall.getSuggestions(player)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-2
@@ -15,8 +15,7 @@ public class WaterfallDefineCommandsListener implements Listener {
|
|||||||
public void onProxyDefineCommandsEvent(io.github.waterfallmc.waterfall.event.ProxyDefineCommandsEvent event) {
|
public void onProxyDefineCommandsEvent(io.github.waterfallmc.waterfall.event.ProxyDefineCommandsEvent event) {
|
||||||
if (event.getReceiver() instanceof ProxiedPlayer) {
|
if (event.getReceiver() instanceof ProxiedPlayer) {
|
||||||
ProxiedPlayer player = (ProxiedPlayer) event.getReceiver();
|
ProxiedPlayer player = (ProxiedPlayer) event.getReceiver();
|
||||||
if (player.hasPermission(CWPermission.BYPASS.permission()))
|
if (player.hasPermission(CWPermission.BYPASS.permission())) return;
|
||||||
return;
|
|
||||||
HashMap<String, Command> commandHashMap = new HashMap<>();
|
HashMap<String, Command> commandHashMap = new HashMap<>();
|
||||||
CommandWhitelistWaterfall.getCommands(player).forEach(cmdName ->
|
CommandWhitelistWaterfall.getCommands(player).forEach(cmdName ->
|
||||||
CommandWhitelistWaterfall.getPlugin().getProxy().getPluginManager().getCommands()
|
CommandWhitelistWaterfall.getPlugin().getProxy().getPluginManager().getCommands()
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
name: CommandWhitelist
|
name: CommandWhitelist
|
||||||
|
author: YouHaveTrouble
|
||||||
version: ${project.version}
|
version: ${project.version}
|
||||||
main: eu.endermite.commandwhitelist.waterfall.CommandWhitelistWaterfall
|
main: eu.endermite.commandwhitelist.waterfall.CommandWhitelistWaterfall
|
||||||
description: You decide what commands players can use or tab complete on your server!
|
description: You decide what commands players can use or tab complete on your server!
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
<groupId>eu.endermite.commandwhitelist</groupId>
|
<groupId>eu.endermite.commandwhitelist</groupId>
|
||||||
<artifactId>CommandWhitelist</artifactId>
|
<artifactId>CommandWhitelist</artifactId>
|
||||||
<version>2.2.2</version>
|
<version>2.2.3</version>
|
||||||
<modules>
|
<modules>
|
||||||
<module>CommandWhitelistCommon</module>
|
<module>CommandWhitelistCommon</module>
|
||||||
<module>CommandWhitelistBukkit</module>
|
<module>CommandWhitelistBukkit</module>
|
||||||
|
|||||||
Reference in New Issue
Block a user