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


Java PermissionUser.addGroup方法代码示例

本文整理汇总了Java中ru.tehkode.permissions.PermissionUser.addGroup方法的典型用法代码示例。如果您正苦于以下问题:Java PermissionUser.addGroup方法的具体用法?Java PermissionUser.addGroup怎么用?Java PermissionUser.addGroup使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ru.tehkode.permissions.PermissionUser的用法示例。


在下文中一共展示了PermissionUser.addGroup方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: execute

import ru.tehkode.permissions.PermissionUser; //导入方法依赖的package包/类
@Override
protected void execute(Event e) {
	for (OfflinePlayer op : p.getAll(e)) {
		PermissionUser permuser = PermissionsEx.getPermissionManager().getUser(op.getUniqueId());
		permuser.addGroup(s.getSingle(e));
	}

}
 
开发者ID:Sharpjaws,项目名称:SharpSK,代码行数:9,代码来源:EffPexAddgroup.java

示例2: addGroup

import ru.tehkode.permissions.PermissionUser; //导入方法依赖的package包/类
boolean addGroup(final UUID player, final Group group) {
	Check.nonNulls("The player/group cannot be null!", player, group);
	if(!this.getManager().isPresent()) { return false; }

	final PermissionUser user = this.getManager().get().getUser(player);
	final PermissionGroup pexGroup = this.getGroupMap().get(group);

	if (!user.inGroup(pexGroup)) {
		user.addGroup(pexGroup);
		return true;
	}
	else { return false; }
}
 
开发者ID:Craftolution,项目名称:CraftoPlugin,代码行数:14,代码来源:PermissionsHandler.java

示例3: playerAddGroup

import ru.tehkode.permissions.PermissionUser; //导入方法依赖的package包/类
@Override
public boolean playerAddGroup(String worldName, String playerName, String groupName) {
    PermissionGroup group = PermissionsEx.getPermissionManager().getGroup(groupName);
    PermissionUser user = PermissionsEx.getPermissionManager().getUser(playerName);
    if (group == null || user == null) {
        return false;
    } else {
        user.addGroup(group);
        return true;
    }
}
 
开发者ID:Realmcraft,项目名称:Vault,代码行数:12,代码来源:Permission_PermissionsEx.java

示例4: addToGroup

import ru.tehkode.permissions.PermissionUser; //导入方法依赖的package包/类
@Override
public boolean addToGroup(OfflinePlayer player, String group) {
    if (!PermissionsEx.getPermissionManager().getGroupNames().contains(group)) {
        return false;
    }

    PermissionUser user = PermissionsEx.getUser(player.getName());
    user.addGroup(group);
    return true;
}
 
开发者ID:AuthMe,项目名称:AuthMeReloaded,代码行数:11,代码来源:PermissionsExHandler.java

示例5: addGroup

import ru.tehkode.permissions.PermissionUser; //导入方法依赖的package包/类
/**
 * Add the permission group of a player, if supported.
 *
 * @param player    The player
 * @param groupName The name of the group.
 * @return True if succeed, false otherwise.
 * False is also returned if this feature isn't supported for the current permissions system.
 */
public boolean addGroup(Player player, String groupName) {
    // Make sure the manager is enabled and is hooked into a permissions system
    if(!isEnabled() || !isHooked())
        return false;

    // Set the group the proper way
    switch (this.permsType) {
        case PERMISSIONS_EX:
            // Permissions Ex
            PermissionUser user = PermissionsEx.getUser(player);
            user.addGroup(groupName);
            return true;

        case PERMISSIONS_BUKKIT:
            // Permissions Bukkit
            // Add the group to the user using a command
            return Bukkit.dispatchCommand(Bukkit.getConsoleSender(), "permissions player addgroup " + player.getName() + " " + groupName);

        case B_PERMISSIONS:
            // bPermissions
            ApiLayer.addGroup(player.getWorld().getName(), CalculableType.USER, player.getName(), groupName);
            return true;

        case ESSENTIALS_GROUP_MANAGER:
            // Essentials Group Manager
            // Add the group to the user using a command
            return Bukkit.dispatchCommand(Bukkit.getConsoleSender(), "manuaddsub " + player.getName() + " " + groupName);

        case Z_PERMISSIONS:
            // zPermissions
            // Add the group to the user using a command
            return Bukkit.dispatchCommand(Bukkit.getConsoleSender(), "permissions player " + player.getName() + " addgroup " + groupName);

        case VAULT:
            // Vault
            vaultPerms.playerAddGroup(player, groupName);
            return true;

        case PERMISSIONS:
            // Permissions
            // FIXME: Add support for this!
            //return this.defaultPerms.group
            return false;
    }

    // Failed, return false
    return false;
}
 
开发者ID:timvisee,项目名称:GlowstoneLanterns,代码行数:57,代码来源:PermissionsManager.java


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