本文整理汇总了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;
}
示例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;
}
示例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()));
}
示例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()));
}
示例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;
}
示例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;
}