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


Java User.getParents方法代码示例

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


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

示例1: getHighestGroup

import org.spongepowered.api.entity.living.player.User; //导入方法依赖的package包/类
public Subject getHighestGroup(User player){
	HashMap<Integer, Subject> subs = new HashMap<Integer, Subject>();
	try {					
		for (SubjectReference sub:player.getParents()){
			if (sub.getCollectionIdentifier().equals(getGroups().getIdentifier()) && (sub.getSubjectIdentifier() != null)){
				Subject subj;
				subj = sub.resolve().get();
				subs.put(subj.getParents().size(), subj);				
			}			
		}			
	} catch (InterruptedException | ExecutionException e) {
		e.printStackTrace();
	}	
	if (!subs.isEmpty()){
		return subs.get(Collections.max(subs.keySet()));
	}
	return null;
}
 
开发者ID:FabioZumbi12,项目名称:Sponge-RankUpper,代码行数:19,代码来源:RUPermsAPI.java

示例2: getHighestGroup

import org.spongepowered.api.entity.living.player.User; //导入方法依赖的package包/类
public Subject getHighestGroup(User player){
	HashMap<Integer, Subject> subs = new HashMap<Integer, Subject>();		
	for (Subject sub:player.getParents()){
		if (sub.getContainingCollection().equals(getGroups()) && (sub.getIdentifier() != null)){
			subs.put(sub.getParents().size(), sub);				
		}			
	}
	if (!subs.isEmpty()){
		return subs.get(Collections.max(subs.keySet()));
	}
	return null;
}
 
开发者ID:FabioZumbi12,项目名称:Sponge-RankUpper,代码行数:13,代码来源:RUPermsAPI.java

示例3: getGroupAndTag

import org.spongepowered.api.entity.living.player.User; //导入方法依赖的package包/类
public Subject getGroupAndTag(User player) {
	HashMap<Integer, Subject> subs = new HashMap<>();
	for (Subject sub:player.getParents()){
		if (sub.getContainingCollection().equals(getGroups()) && (sub.getIdentifier() != null)){
			subs.put(sub.getParents().size(), sub);				
		}			
	}
	return subs.isEmpty() ? null : subs.get(Collections.max(subs.keySet()));
}
 
开发者ID:FabioZumbi12,项目名称:UltimateChat,代码行数:10,代码来源:UCPerms56.java

示例4: getGroupAndTag

import org.spongepowered.api.entity.living.player.User; //导入方法依赖的package包/类
public Subject getGroupAndTag(User player) throws InterruptedException, ExecutionException{
	HashMap<Integer, Subject> subs = new HashMap<>();
	for (SubjectReference sub:player.getParents()){
		if (sub.getCollectionIdentifier().equals(getGroups().getIdentifier()) && (sub.getSubjectIdentifier() != null)){
			Subject subj = sub.resolve().get();
			subs.put(subj.getParents().size(), subj);				
		}			
	}
	return subs.isEmpty() ? null : subs.get(Collections.max(subs.keySet()));
}
 
开发者ID:FabioZumbi12,项目名称:UltimateChat,代码行数:11,代码来源:UCPerms78.java

示例5: getGroup

import org.spongepowered.api.entity.living.player.User; //导入方法依赖的package包/类
public String getGroup(User player){
	for (Subject sub:player.getParents()){
		if (sub.getContainingCollection().equals(getGroups()) && (sub.getIdentifier() != null)){				
			return sub.getIdentifier();
		}
	}
	return null;	
}
 
开发者ID:FabioZumbi12,项目名称:PixelVip,代码行数:9,代码来源:PermsAPI.java

示例6: getGroups

import org.spongepowered.api.entity.living.player.User; //导入方法依赖的package包/类
public Subject getGroups(User player){
	for (Subject sub:player.getParents()){
		if (sub.getContainingCollection().equals(getGroups()) && (sub.getIdentifier() != null)){				
			return sub;
		}
	}
	return null;	
}
 
开发者ID:FabioZumbi12,项目名称:PixelVip,代码行数:9,代码来源:PermsAPI.java


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