forked from Upstream/CommandPanels
Adds hasperm=
This commit is contained in:
parent
f93e126260
commit
3f2c6187bb
@ -75,3 +75,7 @@ purchase:
|
||||
enable: true
|
||||
success: '&aSuccessfully Bought For %cp-args% Experience.'
|
||||
failure: '&cInsufficient Experience!'
|
||||
permission:
|
||||
enable: true
|
||||
success: '&aYou have successfully passed the permission check for "%cp-args%".'
|
||||
failure: '&cInefficient Permissions'
|
@ -16,7 +16,6 @@ import java.io.IOException;
|
||||
import java.net.InetSocketAddress;
|
||||
import java.net.Socket;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
public class Placeholders {
|
||||
CommandPanels plugin;
|
||||
|
@ -184,6 +184,22 @@ public class CommandTags {
|
||||
plugin.tex.sendString(p, plugin.tag + plugin.config.getString("config.format.error") + " " + "commands: " + command);
|
||||
return PaywallOutput.Blocked;
|
||||
}
|
||||
}
|
||||
case "hasperm=": {
|
||||
//if player uses hasperm= [perm]
|
||||
if (p.hasPermission(String.valueOf(command.split("\\s")[1]))) {
|
||||
if (plugin.config.getBoolean("purchase.permission.enable") && removal) {
|
||||
plugin.tex.sendString(panel, PanelPosition.Top, p, Objects.requireNonNull(plugin.config.getString("purchase.permission.success")).replaceAll("%cp-args%", command.split("\\s")[1]));
|
||||
}
|
||||
return PaywallOutput.Passed;
|
||||
} else {
|
||||
if (plugin.config.getBoolean("purchase.currency.enable")) {
|
||||
plugin.tex.sendString(panel, PanelPosition.Top, p, Objects.requireNonNull(plugin.config.getString("purchase.permission.failure")));
|
||||
}
|
||||
return PaywallOutput.Blocked;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
case "tokenpaywall=": {
|
||||
//if player uses tokenpaywall= [price]
|
||||
|
@ -18,8 +18,7 @@ public class DataTabComplete implements TabCompleter {
|
||||
public List<String> onTabComplete(CommandSender sender, Command cmd, String label, String[] args) {
|
||||
if(sender.hasPermission("commandpanel.data")) {
|
||||
ArrayList<String> output = new ArrayList<>();
|
||||
if (args.length>=1
|
||||
&& args[0].equalsIgnoreCase("-s")) {
|
||||
if (args.length>=1 && args[0].equalsIgnoreCase("-s")) {
|
||||
|
||||
args = Arrays.copyOfRange(args, 1, args.length);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user