mirror of
https://github.com/YouHaveTrouble/CommandWhitelist.git
synced 2026-05-12 14:36:56 +00:00
Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 9254c7fc7b | |||
| b9db85278c | |||
| 87e59e3f2b | |||
| 292cac7415 | |||
| 7629b580ae | |||
| 7101d3d713 |
@@ -0,0 +1,28 @@
|
|||||||
|
---
|
||||||
|
name: Bug report
|
||||||
|
about: Create a report to help us improve
|
||||||
|
title: ''
|
||||||
|
labels: bug
|
||||||
|
assignees: YouHaveTrouble
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
**Describe the bug**
|
||||||
|
A clear and concise description of what the bug is.
|
||||||
|
|
||||||
|
**Expected behavior**
|
||||||
|
A clear and concise description of what you expected to happen.
|
||||||
|
|
||||||
|
**To Reproduce**
|
||||||
|
Steps to reproduce the behavior:
|
||||||
|
1. Go to '...'
|
||||||
|
2. Click on '....'
|
||||||
|
3. Scroll down to '....'
|
||||||
|
4. See error
|
||||||
|
|
||||||
|
**Screenshots**
|
||||||
|
If applicable, add screenshots to help explain your problem.
|
||||||
|
|
||||||
|
|
||||||
|
**Additional context**
|
||||||
|
Add any other context about the problem here.
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
---
|
||||||
|
name: Feature request
|
||||||
|
about: Suggest an idea for this project
|
||||||
|
title: ''
|
||||||
|
labels: enhancement
|
||||||
|
assignees: YouHaveTrouble
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
**Is your feature request related to a problem? Please describe.**
|
||||||
|
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
|
||||||
|
|
||||||
|
**Describe the solution you'd like**
|
||||||
|
A clear and concise description of what you want to happen.
|
||||||
|
|
||||||
|
**Describe alternatives you've considered**
|
||||||
|
A clear and concise description of any alternative solutions or features you've considered.
|
||||||
|
|
||||||
|
**Additional context**
|
||||||
|
Add any other context or screenshots about the feature request here.
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
---
|
||||||
|
name: Other issue
|
||||||
|
about: For other issues
|
||||||
|
title: ''
|
||||||
|
labels: ''
|
||||||
|
assignees: YouHaveTrouble
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
|
||||||
@@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
<groupId>eu.endermite</groupId>
|
<groupId>eu.endermite</groupId>
|
||||||
<artifactId>CommandWhitelist</artifactId>
|
<artifactId>CommandWhitelist</artifactId>
|
||||||
<version>1.5.0</version>
|
<version>1.5.2</version>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
|
|
||||||
<name>CommandWhitelist</name>
|
<name>CommandWhitelist</name>
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ precisely what commands players can see and use.
|
|||||||
<li>Overwrites default "no such command" message with your branding
|
<li>Overwrites default "no such command" message with your branding
|
||||||
<li>Blocks tab completion on spigot and bungeecord*</li>
|
<li>Blocks tab completion on spigot and bungeecord*</li>
|
||||||
<li>Blocks command execution on spigot and bungeecord</li>
|
<li>Blocks command execution on spigot and bungeecord</li>
|
||||||
|
<li>Blocks completion and execution of specific subcommands (spigot only)</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
\*This only works on Waterfall and its forks
|
\*This only works on Waterfall and its forks
|
||||||
|
|||||||
@@ -52,6 +52,9 @@ public class ConfigCache {
|
|||||||
}
|
}
|
||||||
public boolean addCommand(String command, String group) {
|
public boolean addCommand(String command, String group) {
|
||||||
try {
|
try {
|
||||||
|
if (this.permList.get(group).contains(command)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
this.permList.get(group).add(command);
|
this.permList.get(group).add(command);
|
||||||
this.config.set("commands."+group, permList.get(group));
|
this.config.set("commands."+group, permList.get(group));
|
||||||
config.save(CommandWhitelist.getPlugin().getDataFolder()+"/config.yml");
|
config.save(CommandWhitelist.getPlugin().getDataFolder()+"/config.yml");
|
||||||
|
|||||||
+1
-1
@@ -30,7 +30,7 @@ public class PlayerCommandPreProcessListener implements Listener {
|
|||||||
String rawCmd = event.getMessage();
|
String rawCmd = event.getMessage();
|
||||||
List<String> bannedSubCommands = CommandsList.getSuggestions(player);
|
List<String> bannedSubCommands = CommandsList.getSuggestions(player);
|
||||||
for (String bannedSubCommand : bannedSubCommands) {
|
for (String bannedSubCommand : bannedSubCommands) {
|
||||||
if (rawCmd.equalsIgnoreCase("/"+bannedSubCommand) || rawCmd.equalsIgnoreCase("/"+bannedSubCommand+" ")) {
|
if (rawCmd.startsWith("/"+bannedSubCommand)) {
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
ConfigCache config = CommandWhitelist.getConfigCache();
|
ConfigCache config = CommandWhitelist.getConfigCache();
|
||||||
player.sendMessage(ChatColor.translateAlternateColorCodes('&', config.getPrefix() + RandomStuff.getMessage(config.getCommandDeniedList(), config.getSubCommandDenied())));
|
player.sendMessage(ChatColor.translateAlternateColorCodes('&', config.getPrefix() + RandomStuff.getMessage(config.getCommandDeniedList(), config.getSubCommandDenied())));
|
||||||
|
|||||||
+2
@@ -25,7 +25,9 @@ public class TabCompleteBlockerListener implements Listener {
|
|||||||
if (cmd.startsWith("/" + scommand + " ")) {
|
if (cmd.startsWith("/" + scommand + " ")) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
try {
|
||||||
suggestions.remove(slast);
|
suggestions.remove(slast);
|
||||||
|
} catch (Exception ignored) {}
|
||||||
}
|
}
|
||||||
event.setCompletions(suggestions);
|
event.setCompletions(suggestions);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user