added * perms for disguise commands

This commit is contained in:
Andrew 2013-09-19 08:19:39 +12:00
parent 7b079d3c2f
commit 5215025ffa
4 changed files with 15 additions and 4 deletions

View File

@ -23,7 +23,7 @@ public class DisguiseCommand implements CommandExecutor {
ArrayList<String> names = new ArrayList<String>();
for (DisguiseType type : DisguiseType.values()) {
String name = type.name().toLowerCase();
if (sender.hasPermission("libsdisguises.disguise." + name))
if (sender.hasPermission("libsdisguises.disguise.*") || sender.hasPermission("libsdisguises.disguise." + name))
names.add(name);
}
Collections.sort(names, String.CASE_INSENSITIVE_ORDER);
@ -32,6 +32,8 @@ public class DisguiseCommand implements CommandExecutor {
private ArrayList<String> forbiddenDisguises(CommandSender sender) {
ArrayList<String> names = new ArrayList<String>();
if (sender.hasPermission("libsdisguises.disguise.*"))
return names;
for (DisguiseType type : DisguiseType.values()) {
String name = type.name().toLowerCase();
if (!sender.hasPermission("libsdisguises.disguise." + name))

View File

@ -28,7 +28,8 @@ public class DisguiseEntityCommand implements CommandExecutor {
ArrayList<String> names = new ArrayList<String>();
for (DisguiseType type : DisguiseType.values()) {
String name = type.name().toLowerCase();
if (sender.hasPermission("libsdisguises.disguiseentity." + name))
if (sender.hasPermission("libsdisguises.disguiseentity.*")
|| sender.hasPermission("libsdisguises.disguiseentity." + name))
names.add(name);
}
Collections.sort(names, String.CASE_INSENSITIVE_ORDER);
@ -37,6 +38,8 @@ public class DisguiseEntityCommand implements CommandExecutor {
private ArrayList<String> forbiddenDisguises(CommandSender sender) {
ArrayList<String> names = new ArrayList<String>();
if (sender.hasPermission("libsdisguises.disguiseentity.*"))
return names;
for (DisguiseType type : DisguiseType.values()) {
String name = type.name().toLowerCase();
if (!sender.hasPermission("libsdisguises.disguiseentity." + name))

View File

@ -24,7 +24,8 @@ public class DisguisePlayerCommand implements CommandExecutor {
ArrayList<String> names = new ArrayList<String>();
for (DisguiseType type : DisguiseType.values()) {
String name = type.name().toLowerCase();
if (sender.hasPermission("libsdisguises.disguiseplayer." + name))
if (sender.hasPermission("libsdisguises.disguiseplayer.*")
|| sender.hasPermission("libsdisguises.disguiseplayer." + name))
names.add(name);
}
Collections.sort(names, String.CASE_INSENSITIVE_ORDER);
@ -33,6 +34,8 @@ public class DisguisePlayerCommand implements CommandExecutor {
private ArrayList<String> forbiddenDisguises(CommandSender sender) {
ArrayList<String> names = new ArrayList<String>();
if (sender.hasPermission("libsdisguises.disguiseplayer.*"))
return names;
for (DisguiseType type : DisguiseType.values()) {
String name = type.name().toLowerCase();
if (!sender.hasPermission("libsdisguises.disguiseplayer." + name))

View File

@ -29,7 +29,8 @@ public class DisguiseRadiusCommand implements CommandExecutor {
ArrayList<String> names = new ArrayList<String>();
for (DisguiseType type : DisguiseType.values()) {
String name = type.name().toLowerCase();
if (sender.hasPermission("libsdisguises.disguiseradius." + name))
if (sender.hasPermission("libsdisguises.disguiseradius.*")
|| sender.hasPermission("libsdisguises.disguiseradius." + name))
names.add(name);
}
Collections.sort(names, String.CASE_INSENSITIVE_ORDER);
@ -38,6 +39,8 @@ public class DisguiseRadiusCommand implements CommandExecutor {
private ArrayList<String> forbiddenDisguises(CommandSender sender) {
ArrayList<String> names = new ArrayList<String>();
if (sender.hasPermission("libsdisguises.disguiseradius.*"))
return names;
for (DisguiseType type : DisguiseType.values()) {
String name = type.name().toLowerCase();
if (!sender.hasPermission("libsdisguises.disguiseradius." + name))