当前位置: 首页>>代码示例>>Java>>正文


Java PermissionDefault.OP属性代码示例

本文整理汇总了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;
}
 
开发者ID:LordAkkarin,项目名称:bukkit-plugin-annotations,代码行数:26,代码来源:PluginAnnotationProcessor.java

示例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);
    }
}
 
开发者ID:CyberdyneCC,项目名称:Thermos-Bukkit,代码行数:10,代码来源:SimplePluginManager.java

示例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;
}
 
开发者ID:OvercastNetwork,项目名称:ProjectAres,代码行数:6,代码来源:AdminChannel.java

示例4: toBukkitPermissionDefault

private static PermissionDefault toBukkitPermissionDefault(String nukkit) {
	if (nukkit == null) {
		return PermissionDefault.OP;
	}
	return PermissionDefault.getByName(nukkit);
}
 
开发者ID:rutgerkok,项目名称:Pokkit,代码行数:6,代码来源:PokkitPermission.java

示例5: ItemData

public ItemData(JavaPlugin javaPlugin) {
    super(javaPlugin, "/itemdata", "Shows item data", new Permission("bgdcore.itemdata", PermissionDefault.OP), "itemdata");
}
 
开发者ID:BurnGames,项目名称:BGDCore,代码行数:3,代码来源:ItemData.java

示例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);
    }

}
 
开发者ID:Taiterio,项目名称:ce,代码行数:56,代码来源:Main.java


注:本文中的org.bukkit.permissions.PermissionDefault.OP属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。