本文整理汇总了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);
}
}