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


Java Team.removeEntry方法代码示例

本文整理汇总了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;
    }
 
开发者ID:AlphaHelixDev,项目名称:AlphaLibary,代码行数:27,代码来源:GameTeam.java

示例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());
        }
    }
}
 
开发者ID:WarzoneMC,项目名称:Warzone,代码行数:21,代码来源:ScoreboardManagerModule.java

示例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();
}
 
开发者ID:edasaki,项目名称:ZentrelaRPG,代码行数:17,代码来源:PlayerDataRPG.java

示例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());
		}
	}
}
 
开发者ID:AlessioDP,项目名称:Parties,代码行数:19,代码来源:PartyHandler.java

示例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();
		}
	}
}
 
开发者ID:AlessioDP,项目名称:Parties,代码行数:18,代码来源:PartyHandler.java

示例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);
	}
}
 
开发者ID:InventivetalentDev,项目名称:CompactNPCLib,代码行数:20,代码来源:NPCPlayer.java

示例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());
        }
    }
}
 
开发者ID:DRE2N,项目名称:FactionsXL,代码行数:8,代码来源:FTeamWrapper.java

示例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);
}
 
开发者ID:kadeska,项目名称:MT_Core,代码行数:8,代码来源:CustomScoreboards.java

示例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()));
            }

        }
    });
}
 
开发者ID:MundoSK,项目名称:MundoSK,代码行数:40,代码来源:SkinManager.java

示例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());
        }
    }
 
开发者ID:gvlfm78,项目名称:BukkitOldCombatMechanics,代码行数:10,代码来源:OCMTask.java

示例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());
}
 
开发者ID:Tom7653,项目名称:Aero,代码行数:6,代码来源:Colliding.java


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