Skip to content

Commit 9eca86f

Browse files
authored
Merge pull request #3 from agentdid127/master
1.1.1
2 parents 10314dc + 2ac31d7 commit 9eca86f

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/main/java/com/agentdid127/agentlib/spigot/util/CommandSystem.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ public class CommandSystem {
1818
//Instance Variables
1919
Plugin plugin;
2020
CommandExecutor commandExecutor;
21+
String permission;
2122

2223

2324
/**
@@ -26,7 +27,8 @@ public class CommandSystem {
2627
* @param plugin
2728
* @param commandExecutor
2829
*/
29-
public CommandSystem(Plugin plugin, CommandExecutor commandExecutor) {
30+
public CommandSystem(Plugin plugin, CommandExecutor commandExecutor, String masterPermission) {
31+
this.permission = masterPermission;
3032
this.plugin = plugin;
3133
this.commandExecutor = commandExecutor;
3234
}
@@ -44,7 +46,7 @@ public CommandSystem(Plugin plugin, CommandExecutor commandExecutor) {
4446
public void registerCommand(String permission, String description, String... aliases) throws NoSuchMethodException, IllegalAccessException, InvocationTargetException, InstantiationException {
4547
PluginCommand command = getCommand(aliases[0], plugin);
4648

47-
command.setPermission("studios." + permission);
49+
command.setPermission(this.permission + permission);
4850
command.setDescription(description);
4951
command.setAliases(Arrays.asList(aliases));
5052
getCommandMap().register(plugin.getDescription().getName(), command);
@@ -98,4 +100,4 @@ private static CommandMap getCommandMap() {
98100

99101
return commandMap;
100102
}
101-
}
103+
}

0 commit comments

Comments
 (0)