本文整理汇总了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);
}
}
示例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);
}
}
示例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());
}
示例4: getReturnType
import org.bukkit.scoreboard.Team; //导入方法依赖的package包/类
@Override
public Class<? extends Team.OptionStatus> getReturnType() {
return Team.OptionStatus.class;
}
示例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))};
}