Java 类org.bukkit.scoreboard.NameTagVisibility 实例源码

项目:CompactNPCLib    文件:NPCPlayer.java   
public void refreshScoreboard() {
    Team team = getScoreboardTeam();

    for (String entry : team.getEntries()) {
        team.removeEntry(entry);
    }
    team.addEntry(getBukkitEntity().getName());

    team.setPrefix(Strings.nullToEmpty(scoreboardPrefix));
    team.setSuffix(Strings.nullToEmpty(scoreboardSuffix));

    if (nameHidden) {
        //          team.setOption(Team.Option.NAME_TAG_VISIBILITY, Team.OptionStatus.NEVER);
        team.setNameTagVisibility(NameTagVisibility.NEVER);
    } else {
        //          team.setOption(Team.Option.NAME_TAG_VISIBILITY, Team.OptionStatus.ALWAYS);
        team.setNameTagVisibility(NameTagVisibility.ALWAYS);
    }
}
项目:iZenith-PVP    文件:Util.java   
public static void initScoreboard() {
    try {
        Vars.scoreboard.registerNewTeam("Member").setPrefix(parseColors("&7"));
        Vars.scoreboard.registerNewTeam("Iron").setPrefix(parseColors("&f"));
        Vars.scoreboard.registerNewTeam("Gold").setPrefix(parseColors("&6"));
        Vars.scoreboard.registerNewTeam("Emerald").setPrefix(parseColors("&a"));
        Vars.scoreboard.registerNewTeam("Diamond").setPrefix(parseColors("&b"));
        Vars.scoreboard.registerNewTeam("Admin").setPrefix(parseColors("&c"));
        Vars.scoreboard.registerNewTeam("Owner").setPrefix(parseColors("&4"));
        Team ghost = Vars.scoreboard.registerNewTeam("Ghost");
        ghost.setNameTagVisibility(NameTagVisibility.NEVER);
        ghost.setCanSeeFriendlyInvisibles(false);
    } catch (Exception e) {
    }
    for (Team t : Vars.scoreboard.getTeams()) {
        Vars.teams.add(t);
    }
}
项目:CubeKrowd-Icerunner    文件:Scoreboardmanager.java   
public void create(){
    ScoreboardManager manager = Bukkit.getScoreboardManager();
    board = manager.getNewScoreboard();
    teamRed = board.registerNewTeam("Red");
    teamRed.setNameTagVisibility(NameTagVisibility.HIDE_FOR_OTHER_TEAMS);
    teamRed.setAllowFriendlyFire(false);
    teamGreen = board.registerNewTeam("Green");
    teamGreen.setNameTagVisibility(NameTagVisibility.HIDE_FOR_OTHER_TEAMS);
    teamGreen.setAllowFriendlyFire(false);
    objective = board.registerNewObjective("time", "dummy");
    objective.setDisplaySlot(DisplaySlot.SIDEBAR);
    objective.setDisplayName("Time");
    Score scoreRed = objective.getScore(ChatColor.RED + "Red:");
    scoreRed.setScore(Game.getGame().getCurrentArena().maxPoints);
    Score scoreGreen = objective.getScore(ChatColor.GREEN + "Green:");
    scoreGreen.setScore(Game.getGame().getCurrentArena().maxPoints);
    teamRed.setPrefix(ChatColor.RED.toString());
    teamGreen.setPrefix(ChatColor.GREEN.toString());
    teamRed.setSuffix(ChatColor.WHITE.toString());
    teamGreen.setSuffix(ChatColor.WHITE.toString());
}
项目:Pokkit    文件:PokkitTeam.java   
@Override
public NameTagVisibility getNameTagVisibility() throws IllegalArgumentException {
    OptionStatus visibility = getOption(Option.NAME_TAG_VISIBILITY);
    switch (visibility) {
    case ALWAYS:
        return NameTagVisibility.ALWAYS;
    case FOR_OTHER_TEAMS:
        return NameTagVisibility.HIDE_FOR_OTHER_TEAMS;
    case FOR_OWN_TEAM:
        return NameTagVisibility.HIDE_FOR_OWN_TEAM;
    case NEVER:
        return NameTagVisibility.NEVER;
    default:
        throw new RuntimeException("Unknown visibility: " + visibility);
    }
}
项目:Pokkit    文件:PokkitTeam.java   
@Override
public void setNameTagVisibility(NameTagVisibility visibility) throws IllegalArgumentException {
    Validate.notNull(visibility, "visibility");
    checkScoreboard();
    switch (visibility) {
    case ALWAYS:
        this.setOption(Option.NAME_TAG_VISIBILITY, OptionStatus.ALWAYS);
        break;
    case HIDE_FOR_OTHER_TEAMS:
        this.setOption(Option.NAME_TAG_VISIBILITY, OptionStatus.FOR_OTHER_TEAMS);
        break;
    case HIDE_FOR_OWN_TEAM:
        this.setOption(Option.NAME_TAG_VISIBILITY, OptionStatus.FOR_OWN_TEAM);
        break;
    case NEVER:
        this.setOption(Option.NAME_TAG_VISIBILITY, OptionStatus.NEVER);
        break;
    default:
        throw new RuntimeException("Unknown name tag visibility: " + visibility);
    }
}
项目:Craftbukkit    文件:CraftTeam.java   
public static EnumNameTagVisibility bukkitToNotch(NameTagVisibility visibility) {
    switch (visibility) {
        case ALWAYS:
            return EnumNameTagVisibility.ALWAYS;
        case NEVER:
            return EnumNameTagVisibility.NEVER;
        case HIDE_FOR_OTHER_TEAMS:
            return EnumNameTagVisibility.HIDE_FOR_OTHER_TEAMS;
        case HIDE_FOR_OWN_TEAM:
            return EnumNameTagVisibility.HIDE_FOR_OWN_TEAM;
        default:
            throw new IllegalArgumentException("Unknown visibility level " + visibility);
    }
}
项目:Craftbukkit    文件:CraftTeam.java   
public static NameTagVisibility notchToBukkit(EnumNameTagVisibility visibility) {
    switch (visibility) {
        case ALWAYS:
            return NameTagVisibility.ALWAYS;
        case NEVER:
            return NameTagVisibility.NEVER;
        case HIDE_FOR_OTHER_TEAMS:
            return NameTagVisibility.HIDE_FOR_OTHER_TEAMS;
        case HIDE_FOR_OWN_TEAM:
            return NameTagVisibility.HIDE_FOR_OWN_TEAM;
        default:
            throw new IllegalArgumentException("Unknown visibility level " + visibility);
    }
}
项目:skRayFall    文件:TeamManager.java   
/**
 * Set the team name tag visibility of a team by team name.
 * 
 * @param team The reference name of the team.
 * @param vis The NameTagVisibility object to be set.
 */
public void setTeamNameTagVisibility(String team, NameTagVisibility vis) {
  if (teamMap.containsKey(team)) {
    teamMap.get(team).setNameTagVisibility(vis);
    for (Object p : Bukkit.getServer().getOnlinePlayers().toArray()) {
      // Debug
      Bukkit.broadcastMessage("Friendly Invisibles set!");
      ((Player) p).getScoreboard().getTeam(team).setNameTagVisibility(vis);
    }
  }
}
项目:SpigotSource    文件:CraftTeam.java   
public static EnumNameTagVisibility bukkitToNotch(NameTagVisibility visibility) {
    switch (visibility) {
        case ALWAYS:
            return EnumNameTagVisibility.ALWAYS;
        case NEVER:
            return EnumNameTagVisibility.NEVER;
        case HIDE_FOR_OTHER_TEAMS:
            return EnumNameTagVisibility.HIDE_FOR_OTHER_TEAMS;
        case HIDE_FOR_OWN_TEAM:
            return EnumNameTagVisibility.HIDE_FOR_OWN_TEAM;
        default:
            throw new IllegalArgumentException("Unknown visibility level " + visibility);
    }
}
项目:SpigotSource    文件:CraftTeam.java   
public static NameTagVisibility notchToBukkit(EnumNameTagVisibility visibility) {
    switch (visibility) {
        case ALWAYS:
            return NameTagVisibility.ALWAYS;
        case NEVER:
            return NameTagVisibility.NEVER;
        case HIDE_FOR_OTHER_TEAMS:
            return NameTagVisibility.HIDE_FOR_OTHER_TEAMS;
        case HIDE_FOR_OWN_TEAM:
            return NameTagVisibility.HIDE_FOR_OWN_TEAM;
        default:
            throw new IllegalArgumentException("Unknown visibility level " + visibility);
    }
}
项目:FlexMC    文件:FlexTeam.java   
@Override
public NameTagVisibility getNameTagVisibility() throws IllegalArgumentException {
    return null;
}
项目:CanaryBukkit    文件:CanaryTeam.java   
public NameTagVisibility getNameTagVisibility() throws IllegalArgumentException {
    throw new NotImplementedException("getNameTagVisibility()");
}
项目:CanaryBukkit    文件:CanaryTeam.java   
public void setNameTagVisibility(NameTagVisibility nameTagVisibility) throws IllegalArgumentException {
    throw new NotImplementedException("setNameTagVisibility(NameTagVisibility)");
}
项目:Craftbukkit    文件:CraftTeam.java   
public NameTagVisibility getNameTagVisibility() throws IllegalArgumentException {
    CraftScoreboard scoreboard = checkState();

    return notchToBukkit(team.getNameTagVisibility());
}
项目:Craftbukkit    文件:CraftTeam.java   
public void setNameTagVisibility(NameTagVisibility visibility) throws IllegalArgumentException {
    CraftScoreboard scoreboard = checkState();

    team.setNameTagVisibility(bukkitToNotch(visibility));
}
项目:Pore    文件:NameTagVisibilityConverter.java   
public static Visibility of(NameTagVisibility slot) {
    return CONVERTER.convert(slot);
}
项目:Pore    文件:NameTagVisibilityConverter.java   
public static NameTagVisibility of(Visibility slot) {
    return CONVERTER.reverse().convert(slot);
}
项目:Pore    文件:PoreTeam.java   
@Override
public NameTagVisibility getNameTagVisibility() throws IllegalArgumentException {
    checkState(); // this is technically against documentation but the documentation is stupid for this method
    return NameTagVisibilityConverter.of(getHandle().getNameTagVisibility());
}
项目:Pore    文件:PoreTeam.java   
@Override
public void setNameTagVisibility(NameTagVisibility visibility) throws IllegalArgumentException {
    checkState(); // same for this
    checkArgument(visibility != null, "Visibility cannot be null");
    getHandle().setNameTagVisibility(NameTagVisibilityConverter.of(visibility));
}
项目:NucleusFramework    文件:ManagedTeam.java   
@Override
public NameTagVisibility getNameTagVisibility() {
    return _team.getNameTagVisibility();
}
项目:NucleusFramework    文件:ManagedTeam.java   
@Override
public void setNameTagVisibility(NameTagVisibility nameTagVisibility) {
    _team.setNameTagVisibility(nameTagVisibility);
}
项目:SpigotSource    文件:CraftTeam.java   
public NameTagVisibility getNameTagVisibility() throws IllegalArgumentException {
    CraftScoreboard scoreboard = checkState();

    return notchToBukkit(team.getNameTagVisibility());
}
项目:SpigotSource    文件:CraftTeam.java   
public void setNameTagVisibility(NameTagVisibility visibility) throws IllegalArgumentException {
    CraftScoreboard scoreboard = checkState();

    team.setNameTagVisibility(bukkitToNotch(visibility));
}
项目:FlexMC    文件:FlexTeam.java   
@Override
public void setNameTagVisibility( NameTagVisibility nameTagVisibility ) throws IllegalArgumentException {

}
项目:NucleusFramework    文件:ITeam.java   
/**
 * Get name tag visibility.
 */
NameTagVisibility getNameTagVisibility();
项目:NucleusFramework    文件:ITeam.java   
/**
 * Set the name tag visibility.
 */
void setNameTagVisibility(NameTagVisibility nameTagVisibility);