本文整理汇总了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;
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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());
}
}
}
}
}
示例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());
}
}
}
}