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


Java PermissionUser类代码示例

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


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

示例1: get

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

import ru.tehkode.permissions.PermissionUser; //导入依赖的package包/类
@EventHandler
public void onJoin(PlayerJoinEvent event)
{
	Player player = event.getPlayer();
	PermissionUser user = PermissionsEx.getUser(player);
	if(!user.getOption("displayname").equals(""))
	{
		player.setDisplayName(user.getOption("displayname"));
	}
	if(!user.getOption("joinmessage").equals(""))
	{
		event.setJoinMessage(ChatUtil.formatMessage(event.getPlayer(), user.getOption("joinmessage")));
	}
	else
	{
		user.setOption("joinmessage", "&6%player &6has entered the fringe.");
		event.setJoinMessage(ChatUtil.formatMessage(event.getPlayer(), user.getOption("joinmessage")));
	}
}
 
开发者ID:Zingalicious,项目名称:Songlantern,代码行数:20,代码来源:JoinListener.java

示例3: getUsers

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

import ru.tehkode.permissions.PermissionUser; //导入依赖的package包/类
private static String getPrefix(Player target){
	if (Bukkit.getPluginManager().getPlugin("PermissionsEx") == null){
		return null;
	} else {
		PermissionUser user = PermissionsEx.getUser(target);
		String prefix = user.getPrefix();
		return prefix;
	}
}
 
开发者ID:AdvancedWhois-Developers,项目名称:AdvancedWhoisPlus-Reloaded,代码行数:10,代码来源:AdditionalWhoisSender.java

示例5: execute

import ru.tehkode.permissions.PermissionUser; //导入依赖的package包/类
@Override
protected void execute(Event e) {

	if (time.getSingle(e).getTicks_i() / 20 > 0) {
		for (OfflinePlayer op : offplayers.getAll(e)) {
			PermissionUser permuser = PermissionsEx.getPermissionManager().getUser(op.getUniqueId());
			permuser.addTimedPermission(perm.getSingle(e), permuser.getPlayer().getWorld().getName(),
					(int) time.getSingle(e).getTicks_i() / 20);
		}
	} else {
		return;
	}
}
 
开发者ID:Sharpjaws,项目名称:SharpSK,代码行数:14,代码来源:EffGiveTimedPexPerm.java

示例6: 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.addPermission(s.getSingle(e));
	}
}
 
开发者ID:Sharpjaws,项目名称:SharpSK,代码行数:8,代码来源:EffAddPexPerm.java

示例7: execute

import ru.tehkode.permissions.PermissionUser; //导入依赖的package包/类
@Override
protected void execute(Event e) {
	for (OfflinePlayer op : offplayers.getAll(e)) {
		PermissionUser permuser = PermissionsEx.getPermissionManager().getUser(op.getUniqueId());
		permuser.removePermission(s.getSingle(e));
	}
}
 
开发者ID:Sharpjaws,项目名称:SharpSK,代码行数:8,代码来源:EffRemovePexPerm.java

示例8: 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

示例9: 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.removeGroup(s.getSingle(e));
	}

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

示例10: getGroupUsers

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

示例11: getPrefix

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

示例12: getSuffix

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

示例13: getGroupNames

import ru.tehkode.permissions.PermissionUser; //导入依赖的package包/类
@Override
public String[] getGroupNames(Player p) {
    PermissionUser user = ru.tehkode.permissions.bukkit.PermissionsEx.getPermissionManager().getUser(p);
    if (user != null) {
        return user.getGroupsNames();
    }
    String[] data = {""};
    return data;
}
 
开发者ID:TheJeterLP,项目名称:ChatEx,代码行数:10,代码来源:PermissionsEx.java

示例14: getFormats

import ru.tehkode.permissions.PermissionUser; //导入依赖的package包/类
public String[] getFormats(Player p) {
	if(pex) {
		PermissionUser pu = PermissionsEx.getPermissionManager().getUser(p);
		return new String[] { ChatColor.translateAlternateColorCodes('&', pu.getPrefix()), ChatColor.translateAlternateColorCodes('&', pu.getSuffix()) };
	}
	
	if(p.isOp())
		return new String[] { "§c", "§7> §r" };	
	return new String[] { "§a", "§7> §r" };	
}
 
开发者ID:maker56,项目名称:UltimateSurvivalGames,代码行数:11,代码来源:ChatListener.java

示例15: getPrefix

import ru.tehkode.permissions.PermissionUser; //导入依赖的package包/类
public static String getPrefix(Player player)
{
	PermissionUser user = PermissionsEx.getUser(player);
	if(user.getPrefix() != null)
	{
		return user.getPrefix();
	}
	else
	{
		return "";
	}
}
 
开发者ID:Zingalicious,项目名称:Cordstone,代码行数:13,代码来源:ChatUtil.java


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