added * perms for disguise commands
This commit is contained in:
parent
7b079d3c2f
commit
5215025ffa
@ -23,7 +23,7 @@ public class DisguiseCommand implements CommandExecutor {
|
|||||||
ArrayList<String> names = new ArrayList<String>();
|
ArrayList<String> names = new ArrayList<String>();
|
||||||
for (DisguiseType type : DisguiseType.values()) {
|
for (DisguiseType type : DisguiseType.values()) {
|
||||||
String name = type.name().toLowerCase();
|
String name = type.name().toLowerCase();
|
||||||
if (sender.hasPermission("libsdisguises.disguise." + name))
|
if (sender.hasPermission("libsdisguises.disguise.*") || sender.hasPermission("libsdisguises.disguise." + name))
|
||||||
names.add(name);
|
names.add(name);
|
||||||
}
|
}
|
||||||
Collections.sort(names, String.CASE_INSENSITIVE_ORDER);
|
Collections.sort(names, String.CASE_INSENSITIVE_ORDER);
|
||||||
@ -32,6 +32,8 @@ public class DisguiseCommand implements CommandExecutor {
|
|||||||
|
|
||||||
private ArrayList<String> forbiddenDisguises(CommandSender sender) {
|
private ArrayList<String> forbiddenDisguises(CommandSender sender) {
|
||||||
ArrayList<String> names = new ArrayList<String>();
|
ArrayList<String> names = new ArrayList<String>();
|
||||||
|
if (sender.hasPermission("libsdisguises.disguise.*"))
|
||||||
|
return names;
|
||||||
for (DisguiseType type : DisguiseType.values()) {
|
for (DisguiseType type : DisguiseType.values()) {
|
||||||
String name = type.name().toLowerCase();
|
String name = type.name().toLowerCase();
|
||||||
if (!sender.hasPermission("libsdisguises.disguise." + name))
|
if (!sender.hasPermission("libsdisguises.disguise." + name))
|
||||||
|
@ -28,7 +28,8 @@ public class DisguiseEntityCommand implements CommandExecutor {
|
|||||||
ArrayList<String> names = new ArrayList<String>();
|
ArrayList<String> names = new ArrayList<String>();
|
||||||
for (DisguiseType type : DisguiseType.values()) {
|
for (DisguiseType type : DisguiseType.values()) {
|
||||||
String name = type.name().toLowerCase();
|
String name = type.name().toLowerCase();
|
||||||
if (sender.hasPermission("libsdisguises.disguiseentity." + name))
|
if (sender.hasPermission("libsdisguises.disguiseentity.*")
|
||||||
|
|| sender.hasPermission("libsdisguises.disguiseentity." + name))
|
||||||
names.add(name);
|
names.add(name);
|
||||||
}
|
}
|
||||||
Collections.sort(names, String.CASE_INSENSITIVE_ORDER);
|
Collections.sort(names, String.CASE_INSENSITIVE_ORDER);
|
||||||
@ -37,6 +38,8 @@ public class DisguiseEntityCommand implements CommandExecutor {
|
|||||||
|
|
||||||
private ArrayList<String> forbiddenDisguises(CommandSender sender) {
|
private ArrayList<String> forbiddenDisguises(CommandSender sender) {
|
||||||
ArrayList<String> names = new ArrayList<String>();
|
ArrayList<String> names = new ArrayList<String>();
|
||||||
|
if (sender.hasPermission("libsdisguises.disguiseentity.*"))
|
||||||
|
return names;
|
||||||
for (DisguiseType type : DisguiseType.values()) {
|
for (DisguiseType type : DisguiseType.values()) {
|
||||||
String name = type.name().toLowerCase();
|
String name = type.name().toLowerCase();
|
||||||
if (!sender.hasPermission("libsdisguises.disguiseentity." + name))
|
if (!sender.hasPermission("libsdisguises.disguiseentity." + name))
|
||||||
|
@ -24,7 +24,8 @@ public class DisguisePlayerCommand implements CommandExecutor {
|
|||||||
ArrayList<String> names = new ArrayList<String>();
|
ArrayList<String> names = new ArrayList<String>();
|
||||||
for (DisguiseType type : DisguiseType.values()) {
|
for (DisguiseType type : DisguiseType.values()) {
|
||||||
String name = type.name().toLowerCase();
|
String name = type.name().toLowerCase();
|
||||||
if (sender.hasPermission("libsdisguises.disguiseplayer." + name))
|
if (sender.hasPermission("libsdisguises.disguiseplayer.*")
|
||||||
|
|| sender.hasPermission("libsdisguises.disguiseplayer." + name))
|
||||||
names.add(name);
|
names.add(name);
|
||||||
}
|
}
|
||||||
Collections.sort(names, String.CASE_INSENSITIVE_ORDER);
|
Collections.sort(names, String.CASE_INSENSITIVE_ORDER);
|
||||||
@ -33,6 +34,8 @@ public class DisguisePlayerCommand implements CommandExecutor {
|
|||||||
|
|
||||||
private ArrayList<String> forbiddenDisguises(CommandSender sender) {
|
private ArrayList<String> forbiddenDisguises(CommandSender sender) {
|
||||||
ArrayList<String> names = new ArrayList<String>();
|
ArrayList<String> names = new ArrayList<String>();
|
||||||
|
if (sender.hasPermission("libsdisguises.disguiseplayer.*"))
|
||||||
|
return names;
|
||||||
for (DisguiseType type : DisguiseType.values()) {
|
for (DisguiseType type : DisguiseType.values()) {
|
||||||
String name = type.name().toLowerCase();
|
String name = type.name().toLowerCase();
|
||||||
if (!sender.hasPermission("libsdisguises.disguiseplayer." + name))
|
if (!sender.hasPermission("libsdisguises.disguiseplayer." + name))
|
||||||
|
@ -29,7 +29,8 @@ public class DisguiseRadiusCommand implements CommandExecutor {
|
|||||||
ArrayList<String> names = new ArrayList<String>();
|
ArrayList<String> names = new ArrayList<String>();
|
||||||
for (DisguiseType type : DisguiseType.values()) {
|
for (DisguiseType type : DisguiseType.values()) {
|
||||||
String name = type.name().toLowerCase();
|
String name = type.name().toLowerCase();
|
||||||
if (sender.hasPermission("libsdisguises.disguiseradius." + name))
|
if (sender.hasPermission("libsdisguises.disguiseradius.*")
|
||||||
|
|| sender.hasPermission("libsdisguises.disguiseradius." + name))
|
||||||
names.add(name);
|
names.add(name);
|
||||||
}
|
}
|
||||||
Collections.sort(names, String.CASE_INSENSITIVE_ORDER);
|
Collections.sort(names, String.CASE_INSENSITIVE_ORDER);
|
||||||
@ -38,6 +39,8 @@ public class DisguiseRadiusCommand implements CommandExecutor {
|
|||||||
|
|
||||||
private ArrayList<String> forbiddenDisguises(CommandSender sender) {
|
private ArrayList<String> forbiddenDisguises(CommandSender sender) {
|
||||||
ArrayList<String> names = new ArrayList<String>();
|
ArrayList<String> names = new ArrayList<String>();
|
||||||
|
if (sender.hasPermission("libsdisguises.disguiseradius.*"))
|
||||||
|
return names;
|
||||||
for (DisguiseType type : DisguiseType.values()) {
|
for (DisguiseType type : DisguiseType.values()) {
|
||||||
String name = type.name().toLowerCase();
|
String name = type.name().toLowerCase();
|
||||||
if (!sender.hasPermission("libsdisguises.disguiseradius." + name))
|
if (!sender.hasPermission("libsdisguises.disguiseradius." + name))
|
||||||
|
Loading…
Reference in New Issue
Block a user