MCPcopy Create free account
hub / github.com/Bukkit/Bukkit / testPermission

Method testPermission

src/main/java/org/bukkit/command/Command.java:84–91  ·  view source on GitHub ↗

Tests the given CommandSender to see if they can perform this command. If they do not have permission, they will be informed that they cannot do this. @param target User to test @return true if they can use it, otherwise false

(CommandSender target)

Source from the content-addressed store, hash-verified

82 * @return true if they can use it, otherwise false
83 */
84 public boolean testPermission(CommandSender target) {
85 if ((permission == null) || (permission.length() == 0) || (target.hasPermission(permission))) {
86 return true;
87 }
88
89 target.sendMessage(ChatColor.RED + "Bukkit sad. Bukkit want you to access command, but Bukkit cannot let you. Bukkit will leak tears :'(");
90 return false;
91 }
92
93 /**
94 * Returns the current lable for this command

Callers 15

executeMethod · 0.80
executeMethod · 0.80
executeMethod · 0.80
executeMethod · 0.80
executeMethod · 0.80
executeMethod · 0.80
executeMethod · 0.80
executeMethod · 0.80
executeMethod · 0.80
executeMethod · 0.80
executeMethod · 0.80
executeMethod · 0.80

Calls 3

hasPermissionMethod · 0.65
sendMessageMethod · 0.65
lengthMethod · 0.45

Tested by

no test coverage detected