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


Java Team.setCanSeeFriendlyInvisibles方法代码示例

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


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

示例1: initScoreboard

import org.bukkit.scoreboard.Team; //导入方法依赖的package包/类
private SimpleScoreboard initScoreboard(PlayerContext playerContext) {
    SimpleScoreboard simpleScoreboard = new SimpleScoreboard(ChatColor.AQUA + "Objectives");

    for (MatchTeam matchTeam : TGM.get().getModule(TeamManagerModule.class).getTeams()) {
        Team team = simpleScoreboard.getScoreboard().registerNewTeam(matchTeam.getId());
        team.setPrefix(matchTeam.getColor().toString());
        team.setCanSeeFriendlyInvisibles(false); // Fixes anti cheat entity visible when it shouldn't be
        team.setAllowFriendlyFire(false);
        team.setOption(Team.Option.COLLISION_RULE, Team.OptionStatus.NEVER);

        for (PlayerContext player : matchTeam.getMembers()) {
            team.addEntry(player.getPlayer().getName());
        }
    }

    Bukkit.getPluginManager().callEvent(new ScoreboardInitEvent(playerContext.getPlayer(), simpleScoreboard));

    simpleScoreboard.send(playerContext.getPlayer());
    scoreboards.put(playerContext.getPlayer(), simpleScoreboard);

    simpleScoreboard.update();

    return simpleScoreboard;
}
 
开发者ID:WarzoneMC,项目名称:Warzone,代码行数:25,代码来源:ScoreboardManagerModule.java

示例2: initScoreboard

import org.bukkit.scoreboard.Team; //导入方法依赖的package包/类
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);
	}
}
 
开发者ID:bobmandude9889,项目名称:iZenith-PVP,代码行数:19,代码来源:Util.java

示例3: 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

示例4: setupTeam

import org.bukkit.scoreboard.Team; //导入方法依赖的package包/类
private void setupTeam(TeamModule teamModule) {
    Team team = this.simpleScoreboard.getScoreboard().registerNewTeam(teamModule.getId());
    team.setDisplayName(teamModule.getName());
    team.setPrefix(teamModule.getColor() + "[" + teamModule.getName().substring(0, 1) + "] ");
    team.setCanSeeFriendlyInvisibles(true);
    team.setOption(Team.Option.COLLISION_RULE, Team.OptionStatus.NEVER);

    for (Player player : teamModule.getPlayers()) {
        team.addPlayer(player);
    }
}
 
开发者ID:Minehut,项目名称:GamePlate,代码行数:12,代码来源:ScoreboardModule.java

示例5: tag_refresh

import org.bukkit.scoreboard.Team; //导入方法依赖的package包/类
public void tag_refresh(Party party) {
	if (party != null) {
		// ProtocolLib
		if (Variables.tablist_enable && ProtocolHandler.isActive()) {
			ProtocolHandler.handleHF();
			for (Player pl : party.getOnlinePlayers())
				ProtocolHandler.send(pl.getUniqueId());
		}
		// Scoreboard
		Team t = scoreboard.getTeam(plugin.getScoreboardPrefix() + party.getName().toLowerCase());
		if (t != null)
			t.unregister();
		if (Variables.tag_enable || Variables.invisibleallies) {
			if (party.getOnlinePlayers().size() > 0) {
				String str = plugin.getScoreboardPrefix()+party.getName().toLowerCase();
				if (str.length() > 10)
					str = str.substring(0, 10);
				Team team = scoreboard.getTeam(str);
				if (team == null) {
					team = scoreboard.registerNewTeam(str);
					if (Variables.tag_enable && Variables.tag_system) {
						team.setPrefix(ChatColor.translateAlternateColorCodes('&', Variables.tag_base_formatprefix).replace("%party%", party.getName()));
						team.setSuffix(ChatColor.translateAlternateColorCodes('&', Variables.tag_base_formatsuffix).replace("%party%", party.getName()));
					} else if (Variables.tag_enable && !Variables.tag_system) {
						if (Variables.tag_custom_prefix)
							if (!party.getPrefix().isEmpty())
								team.setPrefix(ChatColor.translateAlternateColorCodes('&', Variables.tag_custom_formatprefix).replace("%prefix%", party.getPrefix()));
							else
								team.setPrefix("");
						if (Variables.tag_custom_suffix)
							if (!party.getSuffix().isEmpty())
								team.setSuffix(ChatColor.translateAlternateColorCodes('&', Variables.tag_custom_formatsuffix).replace("%suffix%", party.getSuffix()));
							else
								team.setSuffix("");
					} else {
						team.setPrefix("");
						team.setSuffix("");
					}
					if (Variables.invisibleallies)
						team.setCanSeeFriendlyInvisibles(true);
					else
						team.setCanSeeFriendlyInvisibles(false);
				}
				for (Player player : party.getOnlinePlayers()) {
					team.addEntry(player.getName());
				}
			}
		}
	}
}
 
开发者ID:AlessioDP,项目名称:Parties,代码行数:51,代码来源:PartyHandler.java

示例6: tag_addPlayer

import org.bukkit.scoreboard.Team; //导入方法依赖的package包/类
public void tag_addPlayer(Player player, Party party) {
	if (player != null) {
		// ProtocolLib
		if (Variables.tablist_enable && ProtocolHandler.isActive()) {
			ProtocolHandler.handleHF();
			if (party != null)
				for (Player pl : party.getOnlinePlayers())
					ProtocolHandler.send(pl.getUniqueId());
		}
		// Scoreboard
		if (Variables.tag_system || Variables.invisibleallies) {
			if (party != null) {
				String str = plugin.getScoreboardPrefix()+party.getName().toLowerCase();
				if (str.length() > 10)
					str = str.substring(0, 10);
				Team team = scoreboard.getTeam(str);
				if (team == null) {
					String fix;
					team = scoreboard.registerNewTeam(str);
					if (Variables.tag_enable && Variables.tag_system) {
						fix = ChatColor.translateAlternateColorCodes('&', Variables.tag_base_formatprefix).replace("%party%", party.getName());
						if (fix.length() > 16)
							fix = fix.substring(0,16);
						team.setPrefix(fix);
						
						fix = ChatColor.translateAlternateColorCodes('&', Variables.tag_base_formatsuffix).replace("%party%", party.getName());
						if (fix.length() > 16)
							fix = fix.substring(0,16);
						team.setSuffix(fix);
					} else if (Variables.tag_enable && !Variables.tag_system) {
						if (Variables.tag_custom_prefix) {
							if (!party.getPrefix().isEmpty()) {
								fix = ChatColor.translateAlternateColorCodes('&', Variables.tag_custom_formatprefix).replace("%prefix%", party.getPrefix());
								if (fix.length() > 16)
									fix = fix.substring(0,16);
								team.setPrefix(fix);
							} else
								team.setPrefix("");
						}
						if (Variables.tag_custom_suffix) {
							if (!party.getSuffix().isEmpty()) {
								fix = ChatColor.translateAlternateColorCodes('&', Variables.tag_custom_formatsuffix).replace("%suffix%", party.getSuffix());
								if (fix.length() > 16)
									fix = fix.substring(0,16);
								team.setSuffix(fix);
							} else
								team.setSuffix("");
						}
					} else {
						team.setPrefix("");
						team.setSuffix("");
					}
					if (Variables.invisibleallies)
						team.setCanSeeFriendlyInvisibles(true);
					else
						team.setCanSeeFriendlyInvisibles(false);
				}
				team.addEntry(player.getName());
			}
		}
	}
}
 
开发者ID:AlessioDP,项目名称:Parties,代码行数:63,代码来源:PartyHandler.java


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