本文整理汇总了Java中com.massivecraft.factions.entity.MPlayer.getFaction方法的典型用法代码示例。如果您正苦于以下问题:Java MPlayer.getFaction方法的具体用法?Java MPlayer.getFaction怎么用?Java MPlayer.getFaction使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.massivecraft.factions.entity.MPlayer
的用法示例。
在下文中一共展示了MPlayer.getFaction方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: formatFac
import com.massivecraft.factions.entity.MPlayer; //导入方法依赖的package包/类
public static String formatFac(String text, Player sender, Object receiver){
MPlayer mp = MPlayer.get(sender.getUniqueId());
if (!mp.getFaction().isNone()){
Faction fac = mp.getFaction();
text = text
.replace("{fac-id}", fac.getId())
.replace("{fac-name}", fac.getName());
if (fac.hasMotd()){
text = text
.replace("{fac-motd}", fac.getMotd());
}
if (fac.hasDescription()){
text = text
.replace("{fac-description}", fac.getDescription());
}
if (receiver instanceof Player){
MPlayer recmp = MPlayer.get(((Player)receiver).getUniqueId());
text = text
.replace("{fac-relation-name}", fac.getName(recmp))
.replace("{fac-relation-color}", fac.getColorTo(recmp).toString());
}
}
return text;
}
示例2: getInitialRanges
import com.massivecraft.factions.entity.MPlayer; //导入方法依赖的package包/类
@Override
public List<ProtectionRange> getInitialRanges(Player player) {
ArrayList<ProtectionRange> ranges = new ArrayList<>();
MPlayer mplayer = MPlayer.get(player);
if (mplayer.hasFaction()) {
Faction faction = mplayer.getFaction();
MPerm downloadPerm = plugin.getOrRegisterDownloadPerm();
if (downloadPerm.has(mplayer, faction, false)) {
Set<PS> positions = getFactionPositions(player.getWorld(), faction);
ranges.addAll(convertPSToRanges(player.getWorld(), positions, faction));
}
}
return ranges;
}
示例3: replaceFaction
import com.massivecraft.factions.entity.MPlayer; //导入方法依赖的package包/类
public static String replaceFaction(Player player, String msg) {
if (!HookManager.checkFactions()) {
return msg.replace("%faction", "");
}
final MPlayer uplayer = MPlayer.get(player);
final Faction faction = uplayer.getFaction();
return msg.replace("%faction", faction.getName());
}
示例4: getFactionAllyPlayers
import com.massivecraft.factions.entity.MPlayer; //导入方法依赖的package包/类
public static Collection<Player> getFactionAllyPlayers( Player p ) {
/*Collection<Player> factionPlayers = new ArrayList<>();
MPlayer uplayer = MPlayer.get( p );
Map<Rel, List<String>> rels = uplayer.getFaction().getRelationNames(uplayer.getFaction(), rels, skipPeaceful).getFactionNamesPerRelation( uplayer.getFaction() );
for ( Player ps : uplayer.getFaction().getOnlinePlayers() ) {
if ( ps.hasPermission( "bungeesuite.chat.channel.factionally" ) ) {
factionPlayers.add( ps );
}
}
for ( String data : rels.get( Rel.ALLY ) ) {
Faction f = FactionColls.get().getForUniverse( uplayer.getFaction().getUniverse() ).getByName( ChatColor.stripColor( data ) );
for ( Player ps : f.getOnlinePlayers() ) {
if ( ps.hasPermission( "bungeesuite.chat.channel.factionally" ) ) {
factionPlayers.add( ps );
}
}
}
return factionPlayers;*/
Collection<Player> factionPlayers = new ArrayList<Player>();
MPlayer uplayer = MPlayer.get(p);
Faction mine = uplayer.getFaction();
for(Faction f : FactionColl.get().getAll()){
if(mine.getRelationTo(f) == Rel.ALLY){
factionPlayers.addAll(f.getOnlinePlayers());
}
}
return factionPlayers;
}
示例5: isInFaction
import com.massivecraft.factions.entity.MPlayer; //导入方法依赖的package包/类
public boolean isInFaction() {
MPlayer mPlayer = MPlayer.get((Object) player);
Faction faction = mPlayer.getFaction();
String id = faction.getId();
return !(id.equals(Factions.ID_NONE) || id.equals(Factions.ID_SAFEZONE) || id.equals(Factions.ID_WARZONE));
}
示例6: isInGroup
import com.massivecraft.factions.entity.MPlayer; //导入方法依赖的package包/类
@Override
public boolean isInGroup(Player player, String groupName) {
MPlayer mPlayer = MPlayer.get(player);
Faction faction = mPlayer.getFaction();
return (faction != null && faction.getName().equalsIgnoreCase(groupName));
}
示例7: getFactionName
import com.massivecraft.factions.entity.MPlayer; //导入方法依赖的package包/类
@Override
public String getFactionName(Object player) {
MPlayer uplayer = MPlayer.get(player);
Faction faction = uplayer.getFaction();
return faction.getName();
}
示例8: getFactionID
import com.massivecraft.factions.entity.MPlayer; //导入方法依赖的package包/类
@Override
public String getFactionID(Object player) {
MPlayer uplayer = MPlayer.get(player);
Faction faction = uplayer.getFaction();
return faction.getUniverse()+"-" + getFactionName(player);
}