當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。