forked from Upstream/CommandPanels
Adds hasperm=
This commit is contained in:
parent
f93e126260
commit
3f2c6187bb
@ -75,3 +75,7 @@ purchase:
|
|||||||
enable: true
|
enable: true
|
||||||
success: '&aSuccessfully Bought For %cp-args% Experience.'
|
success: '&aSuccessfully Bought For %cp-args% Experience.'
|
||||||
failure: '&cInsufficient 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.InetSocketAddress;
|
||||||
import java.net.Socket;
|
import java.net.Socket;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.stream.Collectors;
|
|
||||||
|
|
||||||
public class Placeholders {
|
public class Placeholders {
|
||||||
CommandPanels plugin;
|
CommandPanels plugin;
|
||||||
|
@ -184,6 +184,22 @@ public class CommandTags {
|
|||||||
plugin.tex.sendString(p, plugin.tag + plugin.config.getString("config.format.error") + " " + "commands: " + command);
|
plugin.tex.sendString(p, plugin.tag + plugin.config.getString("config.format.error") + " " + "commands: " + command);
|
||||||
return PaywallOutput.Blocked;
|
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=": {
|
case "tokenpaywall=": {
|
||||||
//if player uses tokenpaywall= [price]
|
//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) {
|
public List<String> onTabComplete(CommandSender sender, Command cmd, String label, String[] args) {
|
||||||
if(sender.hasPermission("commandpanel.data")) {
|
if(sender.hasPermission("commandpanel.data")) {
|
||||||
ArrayList<String> output = new ArrayList<>();
|
ArrayList<String> output = new ArrayList<>();
|
||||||
if (args.length>=1
|
if (args.length>=1 && args[0].equalsIgnoreCase("-s")) {
|
||||||
&& args[0].equalsIgnoreCase("-s")) {
|
|
||||||
|
|
||||||
args = Arrays.copyOfRange(args, 1, args.length);
|
args = Arrays.copyOfRange(args, 1, args.length);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user