Java 类org.bukkit.scoreboard.Team.OptionStatus 实例源码

项目:MT_Core    文件:CustomScoreboards.java   
public CustomScoreboards(MortuusTerraCore main) {
    this.main = main;
    ScoreboardManager manager = Bukkit.getScoreboardManager();

    pkTeamsBoard = manager.getNewScoreboard();

    pkTeamsBoard.registerNewTeam("NEUTRAL");
    pkTeamsBoard.registerNewTeam("ORANGE");
    pkTeamsBoard.registerNewTeam("RED");

    pkTeamsBoard.getTeam("NEUTRAL").setPrefix(PKStates.NEUTRAL.getColor() + "");
    pkTeamsBoard.getTeam("ORANGE").setPrefix(PKStates.ORANGE.getColor() + "");
    pkTeamsBoard.getTeam("RED").setPrefix(PKStates.RED.getColor() + "");

    for (Team team : pkTeamsBoard.getTeams()) {
        team.setOption(Option.NAME_TAG_VISIBILITY, OptionStatus.ALWAYS);
    }
}
项目:Pokkit    文件:ScoreboardPersister.java   
private OptionStatus toOptionStatus(String string) {
    try {
        return OptionStatus.valueOf(string.toUpperCase());
    } catch (IllegalArgumentException e) {
        return OptionStatus.ALWAYS;
    }
}
项目:Ultra-Hardcore-1.8    文件:UhcTeams.java   
private OptionStatus tStat(int a) {
    if (a == 0) {
        return OptionStatus.ALWAYS;
    } else if (a == 1) {
        return OptionStatus.FOR_OTHER_TEAMS;
    } else if (a == 2) {
        return OptionStatus.FOR_OWN_TEAM;
    }
    return OptionStatus.NEVER;
}
项目:skRayFall    文件:TeamManager.java   
/**
 * Set the a teams option by team name.
 * 
 * @param team The reference name of the team.
 * @param option The option to be set.
 * @param status The options value to be set.
 */
public void setTeamOption(String team, Option option, OptionStatus status) {
  if (teamMap.containsKey(team)) {
    teamMap.get(team).setOption(option, status);
    for (Object p : Bukkit.getServer().getOnlinePlayers().toArray()) {
      // Debug
      Bukkit.broadcastMessage("Team option set!");
      ((Player) p).getScoreboard().getTeam(team).setOption(option, status);
    }
  }
}
项目:skRayFall    文件:Eff1_9MessageOnDeathRule.java   
@SuppressWarnings("unchecked")
@Override
public boolean init(Expression<?>[] exp, int arg1, Kleenean arg2, ParseResult arg3) {
  status = (Expression<OptionStatus>) exp[0];
  team = (Expression<String>) exp[1];
  return true;
}
项目:skRayFall    文件:Eff1_9NameTagVisibility.java   
@SuppressWarnings("unchecked")
@Override
public boolean init(Expression<?>[] exp, int arg1, Kleenean arg2, ParseResult arg3) {
  optionStatus = (Expression<OptionStatus>) exp[0];
  team = (Expression<String>) exp[1];
  return true;
}
项目:CraftoPlugin    文件:ScoreboardManager.java   
public void load() {
    final Scoreboard scoreboard = this.module.getServer().getScoreboardManager().getMainScoreboard();
    for (final Group group : Groups.values()) {
        Team team = scoreboard.getTeam( group.getName().toLowerCase() );
        if (team == null) {
            scoreboard.registerNewTeam(group.getName().toLowerCase());
            team = scoreboard.getTeam(group.getName().toLowerCase());

            team.setOption(Option.COLLISION_RULE, OptionStatus.NEVER);
            team.setAllowFriendlyFire(false);

            Utility.runCommand("scoreboard teams option " + team.getName() + " color " + group.getColor().name());
        }
    }
}