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


Java PermissionAttachmentInfo.getPermission方法代码示例

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


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

示例1: getMaxPermission

import org.bukkit.permissions.PermissionAttachmentInfo; //导入方法依赖的package包/类
public static int getMaxPermission(Player p, String node) {
	int maxLimit = 0;
	for (PermissionAttachmentInfo perm : p.getEffectivePermissions()) {
		String permission = perm.getPermission();
		if (!permission.toLowerCase().startsWith(node.toLowerCase())) {
			continue;
		}
		String[] split = permission.split("\\.");
		try {
			int number = Integer.parseInt(split[split.length - 1]);
			if (number > maxLimit) {
				maxLimit = number;
			}
		} catch (NumberFormatException ignore) { }
	}
	return maxLimit;
}
 
开发者ID:jiongjionger,项目名称:NeverLag,代码行数:18,代码来源:NeverLagUtils.java

示例2: assignRanks

import org.bukkit.permissions.PermissionAttachmentInfo; //导入方法依赖的package包/类
public static void assignRanks(Player p, int tsDbId){
	
	//Permissions
	for(PermissionAttachmentInfo pai : p.getEffectivePermissions()) {
		String perms = pai.getPermission();
		if(UltimateTs.main().getConfig().get("perms."+perms) != null){
			int gTs = UltimateTs.main().getConfig().getInt("perms."+perms);
			BotManager.getBot().addClientToServerGroup(gTs, tsDbId);
		}
    }

	//Default Ranks
	int groupToAssign = UltimateTs.main().getConfig().getInt("config.assignWhenRegister");
	if(groupToAssign > 0){
		BotManager.getBot().addClientToServerGroup(groupToAssign, tsDbId);
	}
}
 
开发者ID:DiscowZombie,项目名称:UltimateTs,代码行数:18,代码来源:PlayerManager.java

示例3: getVaultCapacity

import org.bukkit.permissions.PermissionAttachmentInfo; //导入方法依赖的package包/类
public int getVaultCapacity(Player p)
{
    
    int capacity = getVaultCapacity();
    if(isVaultCapacityPermissionControl())
    {
        
        for(PermissionAttachmentInfo pai : p.getEffectivePermissions())
        {
            String per = pai.getPermission();
            
            if(!per.toLowerCase().startsWith("wowsuchcleaner.vault.capacity.")) continue;
            
            String capacityString = per.split("\\.")[3];
            capacity = Integer.parseInt(capacityString);
            
            continue;
        }
        
    }
    
    return capacity;
}
 
开发者ID:Cnly,项目名称:WowSuchCleaner,代码行数:24,代码来源:SharedConfigManager.java

示例4: getSuperpermsGroup

import org.bukkit.permissions.PermissionAttachmentInfo; //导入方法依赖的package包/类
/**
 * Superperms has no group support, but we fake it (this is slow and stupid
 * since it has to iterate through ALL permissions a player has). But if
 * you're attached to superperms and not using a nice plugin like bPerms
 * and Vault then this is as good as it gets.
 * 
 * @param player
 * @return the group name or null
 */
private String getSuperpermsGroup(Player player) {
    if( player == null )
        return null;
    
    String group = null;
    
    // this code shamelessly adapted from WorldEdit's WEPIF support for superperms
    Permissible perms = getPermissible(player);
    if (perms != null) {
        for (PermissionAttachmentInfo permAttach : perms.getEffectivePermissions()) {
            String perm = permAttach.getPermission();
            if (!(perm.startsWith(GROUP_PREFIX) && permAttach.getValue())) {
                continue;
            }
            
            // we just grab the first "group.X" permission we can find
            group = perm.substring(GROUP_PREFIX.length(), perm.length());
            break;
        }
    }
    
    return group;
}
 
开发者ID:andune,项目名称:anduneCommonBukkitLib,代码行数:33,代码来源:Superperms.java

示例5: loadMultiplier

import org.bukkit.permissions.PermissionAttachmentInfo; //导入方法依赖的package包/类
public void loadMultiplier(Player p){
	int id=1,ip=1;
	for (PermissionAttachmentInfo perms : p.getEffectivePermissions()) {
		String perm = perms.getPermission();
		if (perm.toLowerCase().startsWith("pickupmoney.multiply.")) {
			String[] spl = perm.split("\\.");
			int num = Integer.parseInt(spl[3]);
			if(spl[2].equals("drop") && id<num) id = num;
			else if(spl[2].equals("pickup") && ip<num) ip = num;
		}
	}
	dropMulti.put(p.getUniqueId(),id);
	pickupMulti.put(p.getUniqueId(),ip);

}
 
开发者ID:KickVN,项目名称:PickupMoney,代码行数:16,代码来源:PickupMoney.java


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