[Bleeding] Added Help API. Addresses BUKKIT-863

This commit is contained in:
rmichela
2012-03-01 00:07:05 -05:00
committed by EvilSeph
parent 49c34510e3
commit bba2e1cd2f
16 changed files with 596 additions and 35 deletions

View File

@@ -83,7 +83,7 @@ public abstract class Command {
* @return true if they can use it, otherwise false
*/
public boolean testPermission(CommandSender target) {
if ((permission == null) || (permission.length() == 0) || (target.hasPermission(permission))) {
if (testPermissionSilent(target)) {
return true;
}
@@ -98,6 +98,28 @@ public abstract class Command {
return false;
}
/**
* Tests the given {@link CommandSender} to see if they can perform this command.
* <p />
* No error is sent to the sender.
*
* @param target User to test
* @return true if they can use it, otherwise false
*/
public boolean testPermissionSilent(CommandSender target) {
if ((permission == null) || (permission.length() == 0)) {
return true;
}
for (String p : permission.split(";")) {
if (target.hasPermission(p)) {
return true;
}
}
return false;
}
/**
* Returns the current lable for this command
*