• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java PermissionGroup类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中ru.tehkode.permissions.PermissionGroup的典型用法代码示例。如果您正苦于以下问题:Java PermissionGroup类的具体用法?Java PermissionGroup怎么用?Java PermissionGroup使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



PermissionGroup类属于ru.tehkode.permissions包,在下文中一共展示了PermissionGroup类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: get

import ru.tehkode.permissions.PermissionGroup; //导入依赖的package包/类
@Override
@Nullable
protected String[] get(Event e) {

	Object o = p.getSingle(e);
	PermissionUser a = null;

	if (o instanceof Player) {
		a = PermissionsEx.getUser((Player) o);
	}
	if (o instanceof OfflinePlayer) {
		a = PermissionsEx.getUser(((OfflinePlayer) o).getName());
	} else {
		a = PermissionsEx.getUser(o.toString());
	}

	ArrayList<String> farr = new ArrayList<String>();
	for (PermissionGroup a1 : a.getParents()) {

		farr.add(a1.getName());
	}

	return farr.toArray(new String[farr.size()]);

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


示例2: getGroupMap

import ru.tehkode.permissions.PermissionGroup; //导入依赖的package包/类
private Map<Group, PermissionGroup> getGroupMap() {
	if (!this.getManager().isPresent()) { return Collections.emptyMap(); }
	
	if (this.groupMap == null) {
		this.groupMap = new HashMap<>();
		
		// Update groups
		outer: for (final PermissionGroup pexGroup : this.getManager().get().getGroupList()) {
			for (final Group customGroup : Groups.values()) {
				if (pexGroup.getIdentifier().equals(customGroup.getName())) {
					this.groupMap.put(customGroup, pexGroup);
					continue outer;
				}
			}

			final Group unknownGroup = new Group(pexGroup.getIdentifier(), pexGroup.getPrefix(), pexGroup.isDefault(Utility.getMainWorld().getName()), pexGroup.getRank());
			this.groupMap.put(unknownGroup, pexGroup);
		}
	}
	
	return this.groupMap;
}
 
开发者ID:Craftolution,项目名称:CraftoPlugin,代码行数:23,代码来源:PermissionsHandler.java


示例3: getUsers

import ru.tehkode.permissions.PermissionGroup; //导入依赖的package包/类
Set<UUID> getUsers(final Group group) {
	Check.notNull(group, "The group cannot be null!");
	if (!this.getManager().isPresent()) { return Collections.emptySet(); }

	final PermissionGroup pexGroup = this.getGroupMap().get(group);
	if (pexGroup == null) { return Collections.emptySet(); }

	final HashSet<UUID> uuids = new HashSet<>();

	for (final PermissionUser user : pexGroup.getUsers()) {
		final String hopefullyUuid = user.getIdentifier();
		try {
			final UUID uuid = UUID.fromString(hopefullyUuid);
			uuids.add(uuid);
		}
		catch (final IllegalArgumentException ignore) { }
	}

	return uuids;
}
 
开发者ID:Craftolution,项目名称:CraftoPlugin,代码行数:21,代码来源:PermissionsHandler.java


示例4: getGroupOptionAsBoolean

import ru.tehkode.permissions.PermissionGroup; //导入依赖的package包/类
/**
 * グループのオプション値を、Booleanとして取得する
 * @param group グループ名
 * @param option オプション名
 * @return オプションの値
 */
public boolean getGroupOptionAsBoolean(String group, String option) {
    PermissionGroup g = PermissionsEx.getPermissionManager().getGroup(group);
    if ( g == null ) return false;
    String value = g.getOption(option);
    if ( value != null && value.equals("true") ) {
        return true;
    }
    return false;
}
 
开发者ID:ucchyocean,项目名称:UndineMailer,代码行数:16,代码来源:PermissionsExBridge.java


示例5: getGroupNamesByBooleanOption

import ru.tehkode.permissions.PermissionGroup; //导入依赖的package包/类
/**
 * 指定のオプション値がtrueになっているグループのグループ名を取得する
 * @param option オプション名
 * @return 指定のオプションが設定されているグループのグループ名一覧
 */
public ArrayList<String> getGroupNamesByBooleanOption(String option) {
    ArrayList<String> result = new ArrayList<String>();
    for ( PermissionGroup group : PermissionsEx.getPermissionManager().getGroupList() ) {
        String value = group.getOption(option);
        if ( value == null || !value.equals("true") ) {
            continue;
        }
        result.add(group.getName());
    }
    Collections.sort(result);
    return result;
}
 
开发者ID:ucchyocean,项目名称:UndineMailer,代码行数:18,代码来源:PermissionsExBridge.java


示例6: getGroupUsers

import ru.tehkode.permissions.PermissionGroup; //导入依赖的package包/类
/**
 * 指定したグループのメンバーのプレイヤー名一覧を取得する
 * @param group グループ名
 * @return メンバーのプレイヤー名一覧
 */
public ArrayList<String> getGroupUsers(String group) {
    ArrayList<String> result = new ArrayList<String>();
    PermissionGroup g = PermissionsEx.getPermissionManager().getGroup(group);
    for ( PermissionUser user : g.getUsers() ) {
        result.add(user.getName());
    }
    return result;
}
 
开发者ID:ucchyocean,项目名称:UndineMailer,代码行数:14,代码来源:PermissionsExBridge.java


示例7: getPrefix

import ru.tehkode.permissions.PermissionGroup; //导入依赖的package包/类
@Override
public String getPrefix(Player p) {
    PermissionUser user = ru.tehkode.permissions.bukkit.PermissionsEx.getPermissionManager().getUser(p);
    if (user == null) {
        return "";
    }
    if (!Config.MULTIPREFIXES.getBoolean()) {
        return user.getPrefix(p.getWorld().getName());
    }
    String personalPrefix = user.getOwnPrefix();
    String finalPrefix = "";
    if (personalPrefix != null && !personalPrefix.isEmpty()) {
        finalPrefix = personalPrefix;
    }
    PermissionGroup[] userGroups = user.getGroups();
    int i = 0;
    for (PermissionGroup group : userGroups) {
        String groupPrefix = group.getPrefix();
        if (groupPrefix != null && !groupPrefix.isEmpty()) {
        	if(i > 1) {
        		finalPrefix += " ";
        	}
            finalPrefix += groupPrefix;
            i ++;
        }
    }
    return finalPrefix;
}
 
开发者ID:TheJeterLP,项目名称:ChatEx,代码行数:29,代码来源:PermissionsEx.java


示例8: getSuffix

import ru.tehkode.permissions.PermissionGroup; //导入依赖的package包/类
@Override
public String getSuffix(Player p) {
    PermissionUser user = ru.tehkode.permissions.bukkit.PermissionsEx.getPermissionManager().getUser(p);
    if (user == null) {
        return "";
    }
    if (!Config.MULTISUFFIXES.getBoolean()) {
        return user.getSuffix(p.getWorld().getName());
    }
    String personalSuffix = user.getOwnSuffix();
    String finalSuffix = "";
    if (personalSuffix != null && !personalSuffix.isEmpty()) {
        finalSuffix = personalSuffix;
       
    }
    
    PermissionGroup[] userGroups = user.getGroups();
    int i = 0;
    for (PermissionGroup group : userGroups) {
        String groupSuffix = group.getSuffix();
        if (groupSuffix != null && !groupSuffix.isEmpty()) {
        	 if(i > 1) {
             	finalSuffix += " ";
             }
             i ++;
            finalSuffix += groupSuffix;
        }
    }
    return finalSuffix;
}
 
开发者ID:TheJeterLP,项目名称:ChatEx,代码行数:31,代码来源:PermissionsEx.java


示例9: addGroup

import ru.tehkode.permissions.PermissionGroup; //导入依赖的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


示例10: removeGroup

import ru.tehkode.permissions.PermissionGroup; //导入依赖的package包/类
boolean removeGroup(UUID player, 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.removeGroup(pexGroup);
		return true;
	}
	else { return false; }
}
 
开发者ID:Craftolution,项目名称:CraftoPlugin,代码行数:14,代码来源:PermissionsHandler.java


示例11: getPermissions

import ru.tehkode.permissions.PermissionGroup; //导入依赖的package包/类
List<String> getPermissions(final Group group) {
	Check.notNull(group, "The group cannot be null!");
	if (!this.getManager().isPresent()) { return Collections.emptyList(); }

	final PermissionGroup pexGroup = this.getGroupMap().get(group);
	if (pexGroup == null) { return Collections.emptyList(); }

	return pexGroup.getPermissions(Utility.getMainWorld().getName());
}
 
开发者ID:Craftolution,项目名称:CraftoPlugin,代码行数:10,代码来源:PermissionsHandler.java


示例12: playerAddGroup

import ru.tehkode.permissions.PermissionGroup; //导入依赖的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


示例13: groupAdd

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


示例14: groupRemove

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


示例15: groupHas

import ru.tehkode.permissions.PermissionGroup; //导入依赖的package包/类
@Override
public boolean groupHas(String worldName, String groupName, String permission) {
    PermissionGroup group = PermissionsEx.getPermissionManager().getGroup(groupName);
    if (group == null) {
        return false;
    } else {
        return group.has(permission, worldName);
    }
}
 
开发者ID:Realmcraft,项目名称:Vault,代码行数:10,代码来源:Permission_PermissionsEx.java


示例16: getGroups

import ru.tehkode.permissions.PermissionGroup; //导入依赖的package包/类
@Override
public String[] getGroups() {
    PermissionGroup[] groups = PermissionsEx.getPermissionManager().getGroups();
    if (groups == null || groups.length == 0)
        return null;
    String[] groupNames = new String[groups.length];
    for (int i = 0; i < groups.length; i++) {
        groupNames[i] = groups[i].getName();
    }
    return groupNames;
}
 
开发者ID:Realmcraft,项目名称:Vault,代码行数:12,代码来源:Permission_PermissionsEx.java


示例17: getGroupInfoInteger

import ru.tehkode.permissions.PermissionGroup; //导入依赖的package包/类
@Override
public int getGroupInfoInteger(String world, String groupName, String node, int defaultValue) {
    PermissionGroup group = PermissionsEx.getPermissionManager().getGroup(groupName);
    if (group == null) {
        return defaultValue;
    } else {
        return group.getOptionInteger(node, world, defaultValue);
    }
}
 
开发者ID:Realmcraft,项目名称:Vault,代码行数:10,代码来源:Chat_PermissionsEx.java


示例18: setGroupInfoInteger

import ru.tehkode.permissions.PermissionGroup; //导入依赖的package包/类
@Override
public void setGroupInfoInteger(String world, String groupName, String node, int value) {
    PermissionGroup group = PermissionsEx.getPermissionManager().getGroup(groupName);
    if (group == null) {
        return;
    } else {
        group.setOption(node, world, String.valueOf(value));
    }
}
 
开发者ID:Realmcraft,项目名称:Vault,代码行数:10,代码来源:Chat_PermissionsEx.java


示例19: getGroupInfoDouble

import ru.tehkode.permissions.PermissionGroup; //导入依赖的package包/类
@Override
public double getGroupInfoDouble(String world, String groupName, String node, double defaultValue) {
    PermissionGroup group = PermissionsEx.getPermissionManager().getGroup(groupName);
    if (group == null) {
        return defaultValue;
    } else {
        return group.getOptionDouble(node, world, defaultValue);
    }
}
 
开发者ID:Realmcraft,项目名称:Vault,代码行数:10,代码来源:Chat_PermissionsEx.java


示例20: setGroupInfoDouble

import ru.tehkode.permissions.PermissionGroup; //导入依赖的package包/类
@Override
public void setGroupInfoDouble(String world, String groupName, String node, double value) {
    PermissionGroup group = PermissionsEx.getPermissionManager().getGroup(groupName);
    if (group == null) {
        return;
    } else {
        group.setOption(node, world, String.valueOf(value));
    }
}
 
开发者ID:Realmcraft,项目名称:Vault,代码行数:10,代码来源:Chat_PermissionsEx.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java TileEntityEndPortal类代码示例发布时间:2022-05-22
下一篇:
Java CreationToolEntry类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap