本文整理汇总了Java中org.bukkit.scoreboard.Team.removeEntry方法的典型用法代码示例。如果您正苦于以下问题:Java Team.removeEntry方法的具体用法?Java Team.removeEntry怎么用?Java Team.removeEntry使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.bukkit.scoreboard.Team
的用法示例。
在下文中一共展示了Team.removeEntry方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: removePlayer
import org.bukkit.scoreboard.Team; //导入方法依赖的package包/类
public GameTeam removePlayer(Player p, boolean updateTab) {
TeamLeaveEvent event = new TeamLeaveEvent(p, this);
Bukkit.getPluginManager().callEvent(event);
if (event.isCancelled()) return this;
if (members.contains(p.getName())) {
if (updateTab) {
if (p.getScoreboard() != null) {
Scoreboard s = p.getScoreboard();
if (s.getTeam(this.getTeamName()) != null) {
Team team = s.getTeam(this.getRawTeamName());
team.removeEntry(p.getName());
}
}
}
members.remove(p.getName());
}
return this;
}
示例2: onTeamChange
import org.bukkit.scoreboard.Team; //导入方法依赖的package包/类
@EventHandler(priority = EventPriority.HIGHEST)
public void onTeamChange(TeamChangeEvent event) {
for (MatchTeam matchTeam : TGM.get().getModule(TeamManagerModule.class).getTeams()) {
for (PlayerContext playerContext : matchTeam.getMembers()) {
SimpleScoreboard simpleScoreboard = getScoreboard(playerContext.getPlayer());
if (simpleScoreboard == null) {
simpleScoreboard = initScoreboard(playerContext);
}
if (event.getOldTeam() != null) {
Team old = simpleScoreboard.getScoreboard().getTeam(event.getOldTeam().getId());
old.removeEntry(event.getPlayerContext().getPlayer().getName());
}
Team to = simpleScoreboard.getScoreboard().getTeam(event.getTeam().getId());
to.addEntry(event.getPlayerContext().getPlayer().getName());
}
}
}
示例3: setRank
import org.bukkit.scoreboard.Team; //导入方法依赖的package包/类
@Override
public void setRank(Rank r) {
rank = r;
Team t = board.getEntryTeam(name);
if (t != null)
t.removeEntry(name);
Team team = board.getTeam(rank.rankDisplayName);
if (team == null) {
team = board.registerNewTeam(rank.rankDisplayName);
team.setPrefix(rank.nameColor + "");
team.setAllowFriendlyFire(true);
team.setOption(Team.Option.COLLISION_RULE, Team.OptionStatus.NEVER);
}
team.addEntry(name);
save();
}
示例4: tag_removePlayer
import org.bukkit.scoreboard.Team; //导入方法依赖的package包/类
public void tag_removePlayer(Player player, Party party) {
if (player != null) {
// ProtocolLib
if (Variables.tablist_enable && ProtocolHandler.isActive()) {
ProtocolHandler.handleHF();
ProtocolHandler.send(player.getUniqueId()); // Player is not present into the party anymore
if (party != null)
for (Player pl : party.getOnlinePlayers())
ProtocolHandler.send(pl.getUniqueId());
}
// Scoreboard
if (Variables.tag_system || Variables.invisibleallies) {
Team team = scoreboard.getEntryTeam(player.getName());
if (team != null && team.getName().startsWith(plugin.getScoreboardPrefix()))
team.removeEntry(player.getName());
}
}
}
示例5: tag_delete
import org.bukkit.scoreboard.Team; //导入方法依赖的package包/类
public void tag_delete(Party party) {
// ProtocolLib
if (party != null && Variables.tablist_enable && ProtocolHandler.isActive()) {
ProtocolHandler.handleHF();
for (Player pl : party.getOnlinePlayers())
ProtocolHandler.send(pl.getUniqueId());
}
// Scoreboard
if (Variables.tag_system || Variables.invisibleallies) {
Team t = scoreboard.getTeam(plugin.getScoreboardPrefix() + party.getName().toLowerCase());
if (t != null) {
for (String e : t.getEntries())
t.removeEntry(e);
t.unregister();
}
}
}
示例6: refreshScoreboard
import org.bukkit.scoreboard.Team; //导入方法依赖的package包/类
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);
}
}
示例7: removePlayer
import org.bukkit.scoreboard.Team; //导入方法依赖的package包/类
private void removePlayer(OfflinePlayer player) {
if (members.remove(player)) {
for (Team team : teams.values()) {
team.removeEntry(player.getName());
}
}
}
示例8: switchTeam
import org.bukkit.scoreboard.Team; //导入方法依赖的package包/类
public void switchTeam(Player p, String newTeam) {
for (Team team : pkTeamsBoard.getTeams()) {
if (team.hasEntry(p.getName()))
team.removeEntry(p.getName());
}
addPlayer(p, newTeam);
}
示例9: setNameTag
import org.bukkit.scoreboard.Team; //导入方法依赖的package包/类
public static void setNameTag(Player player, String nameTag) {
if (nameTag != null && nameTag.length() > 16) {
nameTag = nameTag.substring(0, 16); //Nametags can only be up to 16 chars in length
}
Logging.debug(SkinManager.class, "Setting nametag of " + player.getName() + " to " + nameTag);
String oldNameTag = getNameTag(player);
if (nameTag == null) {
nameTag = player.getName();
}
Team team = player.getScoreboard() != null ? player.getScoreboard().getEntryTeam(player.getName()) : null;
if (team != null) {
team.removeEntry(player.getName());
Scheduling.syncDelay(1, () -> team.addEntry(player.getName()));
}
Objective objective = player.getScoreboard() != null ? player.getScoreboard().getObjective(DisplaySlot.BELOW_NAME) : null;
Score score = null;
int actualScore = 0;
if (objective != null) {
score = objective.getScore(player.getName());
actualScore = score.getScore();
score.setScore(0);
}
nameTags.put(player, nameTag);
refreshPlayer(player);
updateTablistName(player);
if (objective != null) {
score.setScore(actualScore);
}
nameTags.forEach((nameTagOwner, s) -> {
if (s.equals(oldNameTag)) {
Team team1 = nameTagOwner.getScoreboard() != null ? nameTagOwner.getScoreboard().getEntryTeam(nameTagOwner.getName()) : null;
if (team1 != null) {
team1.removeEntry(nameTagOwner.getName());
Scheduling.syncDelay(1, () -> team1.addEntry(nameTagOwner.getName()));
}
}
});
}
示例10: removePlayerFromScoreboard
import org.bukkit.scoreboard.Team; //导入方法依赖的package包/类
public void removePlayerFromScoreboard(Player p) {
if (p.getScoreboard().getEntryTeam(p.getName()) != null) return;
Team team = Bukkit.getScoreboardManager().getMainScoreboard().getTeam("ocmInternal");
if (team.getEntries().contains(p.getName())) {
team.removeEntry(p.getName());
}
}
示例11: removeFromTeam
import org.bukkit.scoreboard.Team; //导入方法依赖的package包/类
private void removeFromTeam(Player p) {
Scoreboard s = p.getScoreboard() != null ? p.getScoreboard() : Bukkit.getScoreboardManager().getMainScoreboard();
Team t = s.getTeam("AeroCollide");
t.removeEntry(p.getName());
}