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


Java FPlayer类代码示例

本文整理汇总了Java中com.massivecraft.factions.FPlayer的典型用法代码示例。如果您正苦于以下问题:Java FPlayer类的具体用法?Java FPlayer怎么用?Java FPlayer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: process

import com.massivecraft.factions.FPlayer; //导入依赖的package包/类
@Override
public void process(@NotNull final Message message, @NotNull final PipelineContext context) {
    final FactionsMagic fm = this.factionsHook.getFactionsMagic();
    if (message.isCancelled() || fm == null) return;
    if (!(message.getChannel() instanceof ConfigChannel)) return;
    final ConfigChannel channel = (ConfigChannel) message.getChannel();
    final boolean self = channel.getNode().getNode("factions").getNode("self").getBoolean(false);
    if (!self) return; // TODO: All, relationships
    final Player player = message.getSender().getPlayer();
    if (player == null) return;
    final FPlayer fp = fm.getFPlayers().getByPlayer(player);
    // Get the Faction ID
    final String factionID = fp.getFaction().getId();
    // Get a list of recipients that also have that Faction ID
    final Set<Player> keep = message.getRecipients().stream()
        .filter(member -> factionID.equals(fm.getFPlayers().getByPlayer(member).getFaction().getId()))
        .collect(Collectors.toSet());
    // Retain that list
    message.getRecipients().retainAll(keep);
}
 
开发者ID:Chatterbox,项目名称:hooks,代码行数:21,代码来源:FactionRecipientStage.java

示例2: registerOldFactions

import com.massivecraft.factions.FPlayer; //导入依赖的package包/类
private void registerOldFactions() {
    register("power")
            .scoreSupply(player -> getFPlayer(player)
                    .map(FPlayer::getPowerRounded)
                    .orElse(-1));

    register("f_power")
            .scoreSupply(player -> getOldFaction(player)
                    .map(com.massivecraft.factions.Faction::getPowerRounded)
                    .orElse(-1));

    register("members")
            .scoreSupply(player -> getOldFaction(player)
                    .map(com.massivecraft.factions.Faction::getFPlayers)
                    .map(Collection::size)
                    .orElse(-1));

    register("members_online")
            .scoreSupply(player -> getOldFaction(player)
                    .map(com.massivecraft.factions.Faction::getFPlayers)
                    .map(Collection::size)
                    .orElse(-1));
}
 
开发者ID:games647,项目名称:ScoreboardStats,代码行数:24,代码来源:FactionsVariables.java

示例3: getPlayerTitle

import com.massivecraft.factions.FPlayer; //导入依赖的package包/类
@Override
public String getPlayerTitle(Object player) {
    String title = null;
    
    if (player instanceof Player)
    {
        title = ((FPlayer) FPlayers.i.get((Player) player)).getTitle();
    } else if (player instanceof String)
    {
        title = ((FPlayer) FPlayers.i.get((String) player)).getTitle();
    }
    
    if (title.contains("no title set")) {
        return "";
    }
    return title;
}
 
开发者ID:James137137,项目名称:FactionChat,代码行数:18,代码来源:FactionsAPI_1_8_3_FactionsOne_1.java

示例4: getPlayerRank

import com.massivecraft.factions.FPlayer; //导入依赖的package包/类
@Override
public MyRel getPlayerRank(Object player) {
    Rel role = null;
    if (player instanceof Player)
    {
        role = ((FPlayer) FPlayers.i.get((Player) player)).getRole();
    } else if (player instanceof String)
    {
        role = ((FPlayer) FPlayers.i.get((String) 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,代码行数:23,代码来源:FactionsAPI_1_8_3_FactionsOne_1.java

示例5: onPowerLoss

import com.massivecraft.factions.FPlayer; //导入依赖的package包/类
@EventHandler
public void onPowerLoss(PowerLossEvent event) {
    if (!config.isPatchesDisablePowerLoss()) {
        return;
    }

    FPlayer player = event.getfPlayer();
    Storage storage = Storage.get(player.getPlayer());
    Object value = storage.get("matchDeath");

    if (value != null) {
        event.setMessage("");
        event.setCancelled(true);
    }
}
 
开发者ID:RealizedMC,项目名称:Duels,代码行数:16,代码来源:FactionsHook.java

示例6: process

import com.massivecraft.factions.FPlayer; //导入依赖的package包/类
@Override
public void process(@NotNull final Message message, @NotNull final PipelineContext context) {
    final FactionsMagic fm = this.factionsHook.getFactionsMagic();
    if (message.isCancelled() || fm == null) return;
    final Player player = message.getSender().getPlayer();
    if (player == null) return;
    final FPlayer fp = fm.getFPlayers().getByPlayer(player);
    // Add FactionsMagic to allow for easy access to general Factions methods
    context.getCustomVariables().put("factionsMagic", fm);
    // Add FPlayer as a convenience
    context.getCustomVariables().put("fplayer", fp);
    // Add the faction as a convenience
    context.getCustomVariables().put("faction", fp.getFaction());
}
 
开发者ID:Chatterbox,项目名称:hooks,代码行数:15,代码来源:FactionInfoStage.java

示例7: getFactionName

import com.massivecraft.factions.FPlayer; //导入依赖的package包/类
@Override
public String getFactionName(Object player) {
    if (player instanceof Player)
    {
        return ((FPlayer) FPlayers.i.get((Player) player)).getFaction().getTag();
    } else if (player instanceof String)
    {
        return ((FPlayer) FPlayers.i.get((String) player)).getFaction().getTag();
    }
    else
    {
        return null;
    }
}
 
开发者ID:James137137,项目名称:FactionChat,代码行数:15,代码来源:FactionsAPI_1_8_3_FactionsOne_1.java

示例8: getFactionID

import com.massivecraft.factions.FPlayer; //导入依赖的package包/类
@Override
public String getFactionID(Object player) {
    if (player instanceof Player)
    {
        return ((FPlayer) FPlayers.i.get((Player) player)).getFaction().getId();
    } else if (player instanceof String)
    {
        return ((FPlayer) FPlayers.i.get((Player) player)).getFaction().getId();
    }
    else
    {
        return null;
    }
    
}
 
开发者ID:James137137,项目名称:FactionChat,代码行数:16,代码来源:FactionsAPI_1_8_3_FactionsOne_1.java

示例9: getRelationship

import com.massivecraft.factions.FPlayer; //导入依赖的package包/类
@Override
public MyRel getRelationship(Object player1, Object player2) {
    FPlayer fSenderPlayer = FPlayers.getInstance().getByPlayer(player1);
    Faction SenderFaction = fSenderPlayer.getFaction();
    FPlayer fplayer = FPlayers.getInstance().getByPlayer(player2);
    Relation rel = SenderFaction.getRelationTo(fplayer);
    if (fSenderPlayer.getFactionId().equals(fplayer.getFactionId())) {
        return MyRel.MEMBER;
    }
    if (rel == Relation.NEUTRAL) {
        return MyRel.NEUTRAL;
    }
    if (rel == Relation.ALLY) {
        return MyRel.ALLY;
    }
    if (rel == Relation.ENEMY) {
        return MyRel.ENEMY;
    }
    if (rel == Relation.MEMBER) {
        return MyRel.MEMBER;
    }
    if (hasTruce() && rel == Relation.TRUCE) {
        return MyRel.TRUCE;
    }

    return null;
}
 
开发者ID:James137137,项目名称:FactionChat,代码行数:28,代码来源:FactionsAPI_1_6_2.java

示例10: getRelationship

import com.massivecraft.factions.FPlayer; //导入依赖的package包/类
@Override
public MyRel getRelationship(Object player1, Object player2) {
    FPlayer fSenderPlayer = FPlayers.getInstance().getByPlayer(player1);
    Faction SenderFaction = fSenderPlayer.getFaction();
    FPlayer fplayer = FPlayers.getInstance().getByPlayer(player2);
    Relation rel = SenderFaction.getRelationTo(fplayer);
    if (fSenderPlayer.getFactionId().equals(fplayer.getFactionId()))
    {
        return MyRel.MEMBER;
    }
    if (rel == Relation.NEUTRAL)
    {
        return MyRel.NEUTRAL;
    }
    if (rel == Relation.ALLY)
    {
        return MyRel.ALLY;
    }
    if (rel == Relation.ENEMY)
    {
        return MyRel.ENEMY;
    }
    if (rel == Relation.MEMBER)
    {
        return MyRel.MEMBER;
    }
    
    return null;
}
 
开发者ID:James137137,项目名称:FactionChat,代码行数:30,代码来源:FactionsAPI_1_6.java

示例11: canUseChest

import com.massivecraft.factions.FPlayer; //导入依赖的package包/类
public boolean canUseChest(Player p, FPlayer f, Sign s) {
	
	if(f.getRole().equals(Role.ADMIN)||f.getRole().equals(Role.MODERATOR)) return true;
	
	String IGN = p.getName();
	
	if(s.getLine(0).equals(color("&a[Subclaim]"))) {
		
		if(s.getLine(1).indexOf(IGN)!=-1||s.getLine(2).indexOf(IGN)!=-1||s.getLine(3).indexOf(IGN)!=-1) return true;
		
		return false;
		
	}
	
	return true;
	
}
 
开发者ID:beatlynx,项目名称:SimpleSubclaimsUUID,代码行数:18,代码来源:SubclaimListenerUUID.java

示例12: getRelation

import com.massivecraft.factions.FPlayer; //导入依赖的package包/类
@Override
public ChatColor getRelation(Player player, String factionId) {
    FPlayer fplayer = FPlayers.i.get(player);
    Faction faction = Factions.i.get(factionId);
    return fplayer.getFaction().getRelationTo(faction).getColor();
}
 
开发者ID:novucs,项目名称:factions-top,代码行数:7,代码来源:Factions0108.java

示例13: getOwnerName

import com.massivecraft.factions.FPlayer; //导入依赖的package包/类
@Override
public String getOwnerName(String factionId) {
    FPlayer owner = Factions.i.get(factionId).getFPlayerLeader();
    return owner == null ? null : owner.getName();
}
 
开发者ID:novucs,项目名称:factions-top,代码行数:6,代码来源:Factions0108.java

示例14: getFPlayer

import com.massivecraft.factions.FPlayer; //导入依赖的package包/类
private Optional<FPlayer> getFPlayer(Player player) {
    return Optional.ofNullable(FPlayers.getInstance().getByPlayer(player));
}
 
开发者ID:games647,项目名称:ScoreboardStats,代码行数:4,代码来源:FactionsVariables.java

示例15: getOldFaction

import com.massivecraft.factions.FPlayer; //导入依赖的package包/类
private Optional<com.massivecraft.factions.Faction> getOldFaction(Player player) {
    return getFPlayer(player).map(FPlayer::getFaction);
}
 
开发者ID:games647,项目名称:ScoreboardStats,代码行数:4,代码来源:FactionsVariables.java


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