本文整理匯總了Java中org.bukkit.permissions.PermissionDefault.OP屬性的典型用法代碼示例。如果您正苦於以下問題:Java PermissionDefault.OP屬性的具體用法?Java PermissionDefault.OP怎麽用?Java PermissionDefault.OP使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類org.bukkit.permissions.PermissionDefault
的用法示例。
在下文中一共展示了PermissionDefault.OP屬性的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: processPermission
/**
* Processes a command.
*
* @param permissionAnnotation The annotation.
* @return The generated permission metadata.
*/
protected Map<String, Object> processPermission (Permission permissionAnnotation) {
Map<String, Object> permission = new HashMap<> ();
if (!"".equals (permissionAnnotation.description ())) {
permission.put ("description", permissionAnnotation.description ());
}
if (PermissionDefault.OP != permissionAnnotation.defaultValue ()) {
permission.put ("default", permissionAnnotation.defaultValue ().toString ().toLowerCase ());
}
if (permissionAnnotation.children ().length > 0) {
Map<String, Boolean> childrenList = new HashMap<> ();
for (ChildPermission childPermission : permissionAnnotation.children ()) {
childrenList.put (childPermission.value (), childPermission.inherit ());
}
permission.put ("children", childrenList);
}
return permission;
}
示例2: calculatePermissionDefault
private void calculatePermissionDefault(Permission perm) {
if ((perm.getDefault() == PermissionDefault.OP) || (perm.getDefault() == PermissionDefault.TRUE)) {
defaultPerms.get(true).add(perm);
dirtyPermissibles(true);
}
if ((perm.getDefault() == PermissionDefault.NOT_OP) || (perm.getDefault() == PermissionDefault.TRUE)) {
defaultPerms.get(false).add(perm);
dirtyPermissibles(false);
}
}
示例3: AdminChannel
@Inject AdminChannel(ConsoleCommandSender console, OnlinePlayers players, SettingManagerProvider settings) {
super(FORMAT, BROADCAST_FORMAT, new Permission(PERM_RECEIVE, PermissionDefault.OP));
this.players = players;
this.settings = settings;
this.console = console;
}
示例4: toBukkitPermissionDefault
private static PermissionDefault toBukkitPermissionDefault(String nukkit) {
if (nukkit == null) {
return PermissionDefault.OP;
}
return PermissionDefault.getByName(nukkit);
}
示例5: ItemData
public ItemData(JavaPlugin javaPlugin) {
super(javaPlugin, "/itemdata", "Shows item data", new Permission("bgdcore.itemdata", PermissionDefault.OP), "itemdata");
}
示例6: writePermissions
private void writePermissions() {
Permission mainNode = new Permission("ce.*", "The main permission node for Custom Enchantments.", PermissionDefault.OP);
Permission runecrafting = new Permission("ce.runecrafting", "The permission for Runecrafting.", PermissionDefault.OP);
runecrafting.addParent(mainNode, true);
Permission cmdNode = new Permission("ce.cmd.*", "The permission node for CE's commands.", PermissionDefault.OP);
Permission enchNode = new Permission("ce.ench.*", "The permission node for CE's EnchantManager.getEnchantments().", PermissionDefault.OP);
Permission itemNode = new Permission("ce.item.*", "The permission node for CE's items.", PermissionDefault.OP);
cmdNode.addParent(mainNode, true);
enchNode.addParent(mainNode, true);
itemNode.addParent(mainNode, true);
Permission cmdMenu = new Permission("ce.cmd.menu", "The permission for the CE command 'menu'");
Permission cmdList = new Permission("ce.cmd.reload", "The permission for the CE command 'reload'");
Permission cmdGive = new Permission("ce.cmd.give", "The permission for the CE command 'give'");
Permission cmdChange = new Permission("ce.cmd.change", "The permission for the CE command 'change'");
Permission cmdEnchant = new Permission("ce.cmd.enchant", "The permission for the CE command 'enchant'");
Permission cmdRunecraft = new Permission("ce.cmd.runecrafting", "The permission for the CE command 'runecrafting'");
cmdMenu.addParent(cmdNode, true);
cmdList.addParent(cmdNode, true);
cmdGive.addParent(cmdNode, true);
cmdChange.addParent(cmdNode, true);
cmdEnchant.addParent(cmdNode, true);
cmdRunecraft.addParent(cmdNode, true);
Bukkit.getServer().getPluginManager().addPermission(mainNode);
Bukkit.getServer().getPluginManager().addPermission(runecrafting);
Bukkit.getServer().getPluginManager().addPermission(cmdNode);
Bukkit.getServer().getPluginManager().addPermission(enchNode);
Bukkit.getServer().getPluginManager().addPermission(itemNode);
Bukkit.getServer().getPluginManager().addPermission(cmdMenu);
Bukkit.getServer().getPluginManager().addPermission(cmdList);
Bukkit.getServer().getPluginManager().addPermission(cmdGive);
Bukkit.getServer().getPluginManager().addPermission(cmdChange);
Bukkit.getServer().getPluginManager().addPermission(cmdEnchant);
Bukkit.getServer().getPluginManager().addPermission(cmdRunecraft);
for (CItem ci : items) {
Permission itemTemp = new Permission("ce.item." + ci.getPermissionName(), "The permission for the CE Item '" + ci.getOriginalName() + "'.");
itemTemp.addParent(itemNode, true);
Bukkit.getServer().getPluginManager().addPermission(itemTemp);
}
for (CEnchantment ce : EnchantManager.getEnchantments()) {
Permission enchTemp = new Permission("ce.ench." + ce.getPermissionName(), "The permission for the CE Enchantment '" + ce.getOriginalName() + "'.");
enchTemp.addParent(enchNode, true);
Bukkit.getServer().getPluginManager().addPermission(enchTemp);
}
}