本文整理汇总了Java中com.massivecraft.factions.entity.UPlayer类的典型用法代码示例。如果您正苦于以下问题:Java UPlayer类的具体用法?Java UPlayer怎么用?Java UPlayer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
UPlayer类属于com.massivecraft.factions.entity包,在下文中一共展示了UPlayer类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: getRelationTo
import com.massivecraft.factions.entity.UPlayer; //导入依赖的package包/类
@Override
public Rel getRelationTo(Object object) {
if (this.id == "@console") return Rel.NEUTRAL;
if (object instanceof Faction) {
object = FactionColls.get().get2(((Faction) object).getId());
}
if (object instanceof FPlayer) {
object = UPlayer.get(((FPlayer) object).getId());
}
if (object instanceof Player) {
object = UPlayer.get((Player) object);
}
return Factions_2_6.convertRelationship(this.uplayer.getRelationTo((RelationParticipator) object));
}
开发者ID:markhughes,项目名称:FactionsFramework,代码行数:19,代码来源:FPlayer_2_6.java
示例2: getClaimInformees
import com.massivecraft.factions.entity.UPlayer; //导入依赖的package包/类
public static Set<UPlayer> getClaimInformees(UPlayer usender, com.massivecraft.factions.entity.Faction oldFaction, com.massivecraft.factions.entity.Faction newFaction, Object clazz) {
Set<UPlayer> ret = new HashSet<UPlayer>();
if (usender != null) ret.add(usender);
for (com.massivecraft.factions.entity.Faction faction : com.massivecraft.factions.entity.FactionColls.get().get2(usender).getColl().getAll()) {
if (faction == null) continue;
if (faction.isNone()) continue;
ret.addAll(getUPlayersIn(faction, clazz));
}
if (MConf.get().logLandClaims) {
ret.add(UPlayer.get(IdUtil.getConsole()));
}
return ret;
}
开发者ID:markhughes,项目名称:FactionsFramework,代码行数:18,代码来源:Factions_2_6.java
示例3: getRelationTo
import com.massivecraft.factions.entity.UPlayer; //导入依赖的package包/类
@Override
public Rel getRelationTo(Object comparing) {
// Convert our FactionsFramework Factions object to their object
if (comparing instanceof Faction) {
Faction faction = (Faction) comparing;
comparing = this.faction.getColl().get(faction.getId());
}
// Convert our FactionsFramework FPlayer object to their object
if (comparing instanceof FPlayer) {
FPlayer fplayer = (FPlayer) comparing;
comparing = UPlayer.get(fplayer.getId());
}
if (comparing instanceof RelationParticipator) {
Rel rel = Factions_2_6.convertRelationship(this.faction.getRelationTo((RelationParticipator) comparing));
return rel;
}
return null;
}
开发者ID:markhughes,项目名称:FactionsFramework,代码行数:25,代码来源:Faction_2_6.java
示例4: canCast
import com.massivecraft.factions.entity.UPlayer; //导入依赖的package包/类
@Override
public boolean canCast(Player player, Spell spell) {
UPlayer uplayer = UPlayer.get(player);
Location loc = player.getLocation();
Faction faction = BoardColls.get().getFactionAt(PS.valueOf(loc));
if (faction != null && !faction.isNone()) {
if (ConfigOptions.FACTION_CASTING) {
if (uplayer.getFactionId().equals(faction.getId())) {
return true;
}
}
Language.sendError("spell.cast.faction", player);
return false;
}
return true;
}
开发者ID:mcardy,项目名称:Zephyrus-II,代码行数:17,代码来源:FactionsHook.java
示例5: canTarget
import com.massivecraft.factions.entity.UPlayer; //导入依赖的package包/类
@Override
public boolean canTarget(Player player, LivingEntity entity, boolean friendly) {
if (entity instanceof Player) {
Player target = (Player) entity;
UPlayer uplayer = UPlayer.get(player);
UPlayer utarget = UPlayer.get(target);
if (uplayer.getFaction() != null && uplayer.getFaction().getUPlayers().contains(utarget)) {
if (friendly) {
return true;
} else {
Language.sendError("user.target.entity.faction", player);
return false;
}
}
}
return true;
}
开发者ID:mcardy,项目名称:Zephyrus-II,代码行数:18,代码来源:FactionsHook.java
示例6: FPlayer_2_6
import com.massivecraft.factions.entity.UPlayer; //导入依赖的package包/类
public FPlayer_2_6(String id) {
this.id = id;
if (this.id == "@console") {
this.uplayer = UPlayer.get(Bukkit.getConsoleSender());
} else {
this.uplayer = UPlayer.get(id);
}
}
开发者ID:markhughes,项目名称:FactionsFramework,代码行数:10,代码来源:FPlayer_2_6.java
示例7: getUPlayersIn
import com.massivecraft.factions.entity.UPlayer; //导入依赖的package包/类
@SuppressWarnings("unchecked")
public static List<UPlayer> getUPlayersIn(com.massivecraft.factions.entity.Faction faction, Object clazz) {
try {
List<UPlayer> uplayers = (List<UPlayer>) faction.getClass().getMethod("getUPlayers").invoke(clazz);
return uplayers;
} catch(Exception e) { }
return new ArrayList<UPlayer>();
}
开发者ID:markhughes,项目名称:FactionsFramework,代码行数:10,代码来源:Factions_2_6.java
示例8: getMembers
import com.massivecraft.factions.entity.UPlayer; //导入依赖的package包/类
@Override
public Set<FPlayer> getMembers() {
Set<FPlayer> members = new TreeSet<FPlayer>();
for (UPlayer uplayer : this.faction.getUPlayers()) {
members.add(FPlayers.getById(uplayer.getId()));
}
return members;
}
开发者ID:markhughes,项目名称:FactionsFramework,代码行数:11,代码来源:Faction_2_6.java
示例9: getMembersExcept
import com.massivecraft.factions.entity.UPlayer; //导入依赖的package包/类
@Override
public Set<FPlayer> getMembersExcept(Rel... rels) {
Set<FPlayer> members = new TreeSet<FPlayer>();
ArrayList<Rel> relsList = new ArrayList<Rel>();
for (Rel rel : rels) relsList.add(rel);
for (UPlayer uplayer : this.faction.getUPlayers()) {
FPlayer fplayer = FPlayers.getById(uplayer.getId());
if (relsList.contains(fplayer.getRole())) members.add(fplayer);
}
return members;
}
开发者ID:markhughes,项目名称:FactionsFramework,代码行数:16,代码来源:Faction_2_6.java
示例10: getOfficers
import com.massivecraft.factions.entity.UPlayer; //导入依赖的package包/类
@Override
public Set<FPlayer> getOfficers() {
Set<FPlayer> officers = new TreeSet<FPlayer>();
for (UPlayer uplayer : this.faction.getUPlayers()) {
if (uplayer.getRole() != com.massivecraft.factions.Rel.OFFICER) continue;
officers.add(FPlayers.getById(uplayer.getId()));
}
return officers;
}
开发者ID:markhughes,项目名称:FactionsFramework,代码行数:13,代码来源:Faction_2_6.java
示例11: getFactionAccountHolder
import com.massivecraft.factions.entity.UPlayer; //导入依赖的package包/类
/**
* Get a FactionAccountHolder for the faction of which player is a member, if any.
* @param player player to get the faction for
* @return FactionAccountHolder for the faction of which player is a member, if any. null otherwise.
*/
public FactionAccountHolder getFactionAccountHolder(Player player) {
UPlayer fplayer = UPlayer.get(player);
Faction playerFaction = fplayer.getFaction();
return playerFaction != null? new FactionAccountHolder(playerFaction) : null;
}
开发者ID:sakunc,项目名称:Gringotts-,代码行数:12,代码来源:FactionsHandler.java
示例12: canBuild
import com.massivecraft.factions.entity.UPlayer; //导入依赖的package包/类
@Override
public boolean canBuild(Player player, Location loc) {
UPlayer uplayer = UPlayer.get(player);
Faction faction = BoardColls.get().getFactionAt(PS.valueOf(loc));
if (faction != null) {
if (uplayer.getFactionId().equals(faction.getId())) {
return true;
}
Language.sendError("user.target.block.faction", player);
return false;
}
return true;
}
开发者ID:mcardy,项目名称:Zephyrus-II,代码行数:14,代码来源:FactionsHook.java
示例13: canBuild
import com.massivecraft.factions.entity.UPlayer; //导入依赖的package包/类
@Override
public boolean canBuild(Player player, Location loc) {
UPlayer uplayer = UPlayer.get(player);
Faction faction = BoardColls.get().getFactionAt(PS.valueOf(loc));
if (faction != null) {
if (faction.getUPlayers().contains(uplayer)) {
return true;
}
return false;
}
return true;
}
开发者ID:mcardy,项目名称:ProtectionsLib,代码行数:13,代码来源:FactionsProtection.java
示例14: canPvp
import com.massivecraft.factions.entity.UPlayer; //导入依赖的package包/类
@Override
public boolean canPvp(Player player, Player target) {
UPlayer uplayer = UPlayer.get(player);
UPlayer utarget = UPlayer.get(target);
if (uplayer.getFaction() != null
&& uplayer.getFaction().getUPlayers().contains(utarget)) {
return false;
}
return true;
}
开发者ID:mcardy,项目名称:ProtectionsLib,代码行数:11,代码来源:FactionsProtection.java
示例15: getFactionColorsName
import com.massivecraft.factions.entity.UPlayer; //导入依赖的package包/类
@SuppressWarnings("static-access")
public String getFactionColorsName(Player player, Player rec) {
UPlayer uplayer = UPlayer.get(player);
Faction faction = uplayer.getFaction();
String role = uplayer.getRole().getPrefix();
String fac = role + faction.getName();
if (faction.isNone()) {
return "";
} else {
ChatColor color = faction.getColorTo(UPlayer.get(rec));
return color + chatPlugin.utils.removeCussWords(fac, false,
player, true, color + "") + " ";
}
}
开发者ID:Esaych,项目名称:DDCustomPlugin,代码行数:15,代码来源:ChatFacsTowns.java
示例16: getFacPlayers
import com.massivecraft.factions.entity.UPlayer; //导入依赖的package包/类
public ArrayList<Player> getFacPlayers(Player player) {
if (getFacName(player).equals("")) {
return new ArrayList<Player>();
} else {
List<Player> fplayers = UPlayer.get(player).getFaction().getOnlinePlayers();
ArrayList<Player> players = new ArrayList<Player>();
for (Player p : Bukkit.getOnlinePlayers()) {
if (p.hasPermission("ddchat.staffchat") || fplayers.contains(p))
players.add(p);
}
return players;
}
}
开发者ID:Esaych,项目名称:DDCustomPlugin,代码行数:14,代码来源:ChatFacsTowns.java
示例17: getFaction
import com.massivecraft.factions.entity.UPlayer; //导入依赖的package包/类
@SuppressWarnings("static-access")
public String getFaction(Player player, Player rec) {
UPlayer uplayer = UPlayer.get(player);
Faction faction = uplayer.getFaction();
String role = uplayer.getRole().getPrefix();
String fac = role + faction.getName();
if (faction.isNone()) {
return "";
} else {
ChatColor color = faction.getColorTo(UPlayer.get(rec));
return color + chatPlugin.utils.removeCussWords(fac, false,
player, true, color + "") + " ";
}
}
开发者ID:Esaych,项目名称:DDCustomPlugin,代码行数:15,代码来源:ChatFacsTowns.java
示例18: fBreak
import com.massivecraft.factions.entity.UPlayer; //导入依赖的package包/类
private boolean fBreak(Location loc, Player p) {
Faction f = UPlayer.get(p).getFaction();
Faction ff = BoardColls.get().getFactionAt(PS.valueOf(loc.getBlock()));
if(ff != null) {
return ff.getId() == f.getId();
}
return true;
}
开发者ID:Amunak,项目名称:DropsToInventory,代码行数:9,代码来源:BreakListener.java
示例19: getPlayerTitle
import com.massivecraft.factions.entity.UPlayer; //导入依赖的package包/类
@Override
public String getPlayerTitle(Object player) {
String title = UPlayer.get(player).getTitle();
if (title.contains("no title set")) {
return "";
}
return title;
}
开发者ID:James137137,项目名称:FactionChat,代码行数:9,代码来源:FactionsAPI_2_6_0.java
示例20: getPlayerRank
import com.massivecraft.factions.entity.UPlayer; //导入依赖的package包/类
@Override
public MyRel getPlayerRank(Object player) {
Rel role = UPlayer.get(player).getRole();
if (role.equals(Rel.LEADER)) {
return MyRel.LEADER;
} else if (role.equals(Rel.OFFICER)) {
return MyRel.OFFICER;
} else if (role.equals(Rel.MEMBER)) {
return MyRel.MEMBER;
} else if (role.equals(Rel.RECRUIT)) {
return MyRel.RECRUIT;
} else {
return MyRel.NEUTRAL;
}
}
开发者ID:James137137,项目名称:FactionChat,代码行数:16,代码来源:FactionsAPI_2_6_0.java
注:本文中的com.massivecraft.factions.entity.UPlayer类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论