mirror of
https://github.com/YouHaveTrouble/CommandWhitelist.git
synced 2026-05-11 22:16:57 +00:00
Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 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>
|
||||
<artifactId>CommandWhitelist</artifactId>
|
||||
<version>1.5.0</version>
|
||||
<version>1.5.1</version>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<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>Blocks tab completion 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>
|
||||
|
||||
\*This only works on Waterfall and its forks
|
||||
|
||||
@@ -52,6 +52,9 @@ public class ConfigCache {
|
||||
}
|
||||
public boolean addCommand(String command, String group) {
|
||||
try {
|
||||
if (this.permList.get(group).contains(command)) {
|
||||
return true;
|
||||
}
|
||||
this.permList.get(group).add(command);
|
||||
this.config.set("commands."+group, permList.get(group));
|
||||
config.save(CommandWhitelist.getPlugin().getDataFolder()+"/config.yml");
|
||||
|
||||
+1
-1
@@ -30,7 +30,7 @@ public class PlayerCommandPreProcessListener implements Listener {
|
||||
String rawCmd = event.getMessage();
|
||||
List<String> bannedSubCommands = CommandsList.getSuggestions(player);
|
||||
for (String bannedSubCommand : bannedSubCommands) {
|
||||
if (rawCmd.equalsIgnoreCase("/"+bannedSubCommand) || rawCmd.equalsIgnoreCase("/"+bannedSubCommand+" ")) {
|
||||
if (rawCmd.startsWith("/"+bannedSubCommand)) {
|
||||
event.setCancelled(true);
|
||||
ConfigCache config = CommandWhitelist.getConfigCache();
|
||||
player.sendMessage(ChatColor.translateAlternateColorCodes('&', config.getPrefix() + RandomStuff.getMessage(config.getCommandDeniedList(), config.getSubCommandDenied())));
|
||||
|
||||
Reference in New Issue
Block a user