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


Java Team.OptionStatus方法代码示例

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


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

示例1: parseInternal

import org.bukkit.scoreboard.Team; //导入方法依赖的package包/类
@Override
protected Team.OptionStatus parseInternal(Node node, String text) throws FormatException, InvalidXMLException {
    switch(node.getValue()) {
        case "yes":
        case "on":
        case "true":
            return Team.OptionStatus.ALWAYS;

        case "no":
        case "off":
        case "false":
            return Team.OptionStatus.NEVER;

        case "ally":
        case "allies":
            return Team.OptionStatus.FOR_OWN_TEAM;

        case "enemy":
        case "enemies":
            return Team.OptionStatus.FOR_OTHER_TEAMS;

        default:
            throw new InvalidXMLException("Invalid team relationship", node);
    }
}
 
开发者ID:OvercastNetwork,项目名称:ProjectAres,代码行数:26,代码来源:TeamRelationParser.java

示例2: updatePartyScoreboardTeam

import org.bukkit.scoreboard.Team; //导入方法依赖的package包/类
protected void updatePartyScoreboardTeam(Party party, Team team, boolean forObservers) {
    logger.fine("Updating scoreboard team " + toString(team) + " for party " + party);

    team.setDisplayName(party.getName());
    team.setPrefix(party.getColor().toString());
    team.setSuffix(ChatColor.WHITE.toString());

    team.setCanSeeFriendlyInvisibles(true);
    team.setAllowFriendlyFire(getMatch().getMapInfo().friendlyFire);
    team.setOption(Team.Option.COLLISION_RULE, Team.OptionStatus.NEVER);

    if(!forObservers && party instanceof Competitor) {
        Team.OptionStatus nameTags = ((Competitor) party).getNameTagVisibility();

        // #HACK until this is fixed https://bugs.mojang.com/browse/MC-48730 we need to
        // ensure enemy name tags are always hidden for GS.
        if(getMatch().getMatchModule(GhostSquadronMatchModule.class) != null) {
            switch(nameTags) {
                case ALWAYS: nameTags = Team.OptionStatus.FOR_OWN_TEAM; break;
                case FOR_OTHER_TEAMS: nameTags = Team.OptionStatus.NEVER; break;
            }
        }

        team.setOption(Team.Option.NAME_TAG_VISIBILITY, nameTags);
    } else {
        team.setOption(Team.Option.NAME_TAG_VISIBILITY, Team.OptionStatus.ALWAYS);
    }
}
 
开发者ID:OvercastNetwork,项目名称:ProjectAres,代码行数:29,代码来源:ScoreboardMatchModule.java

示例3: parseNameTagVisibility

import org.bukkit.scoreboard.Team; //导入方法依赖的package包/类
public static PropertyBuilder<Team.OptionStatus, ?> parseNameTagVisibility(Element parent, String name) throws InvalidXMLException {
    return new PropertyBuilder<>(parent, name, new TeamRelationParser());
}
 
开发者ID:OvercastNetwork,项目名称:ProjectAres,代码行数:4,代码来源:XMLUtils.java

示例4: getReturnType

import org.bukkit.scoreboard.Team; //导入方法依赖的package包/类
@Override
public Class<? extends Team.OptionStatus> getReturnType() {
	return Team.OptionStatus.class;
}
 
开发者ID:TheLimeGlass,项目名称:Skellett,代码行数:5,代码来源:ExprTeamOptions.java

示例5: get

import org.bukkit.scoreboard.Team; //导入方法依赖的package包/类
@Override
@Nullable
protected Team.OptionStatus[] get(Event e) {
	return new Team.OptionStatus[]{team.getSingle(e).getOption(option.getSingle(e))};
}
 
开发者ID:TheLimeGlass,项目名称:Skellett,代码行数:6,代码来源:ExprTeamOptions.java


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