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


Java Scoreboard.getTeam方法代码示例

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


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

示例1: removePlayer

import org.bukkit.scoreboard.Scoreboard; //导入方法依赖的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: setOverheadNamePrefix

import org.bukkit.scoreboard.Scoreboard; //导入方法依赖的package包/类
/**
 * Sets a prefix for a player's overhead name by adding them to a scoreboard team.
 * Don't use this if scoreboard teams are being used for any other purpose.
 */
private static void setOverheadNamePrefix(Player player, String prefix) {
    final Scoreboard scoreboard = player.getServer().getScoreboardManager().getMainScoreboard();
    prefix = prefix.substring(0, Math.min(prefix.length(), 14));

    Team team = scoreboard.getTeam(prefix);
    if(team == null) {
        team = scoreboard.registerNewTeam(prefix);
        team.setPrefix(prefix);
        team.setOption(Team.Option.COLLISION_RULE, Team.OptionStatus.NEVER);
    }
    team.addPlayer(player);
}
 
开发者ID:OvercastNetwork,项目名称:ProjectAres,代码行数:17,代码来源:PlayerAppearanceChanger.java

示例3: onPlayerChangedTeam

import org.bukkit.scoreboard.Scoreboard; //导入方法依赖的package包/类
/**
 * When a player changes team, make sure the scoreboard reflects it
 */
@EventHandler
public void onPlayerChangedTeam(PlayerChangedTeamEvent event) {
    Scoreboard board = boards.get(event.getTeam().getMatch());
    org.bukkit.scoreboard.Team sbTeam = board.getTeam(event.getTeam().getId());
    sbTeam.addPlayer(event.getPlayer());
}
 
开发者ID:redwallhp,项目名称:AthenaGM,代码行数:10,代码来源:ScoreboardModule.java

示例4: addToTeam

import org.bukkit.scoreboard.Scoreboard; //导入方法依赖的package包/类
private void addToTeam(Player p) {
    Scoreboard s = p.getScoreboard() != null ? p.getScoreboard() : Bukkit.getScoreboardManager().getMainScoreboard();
    Team t = s.getTeam("AeroCollide");
    if(t == null) {
        s.registerNewTeam("AeroCollide");
        t = s.getTeam("AeroCollide");
        Bukkit.dispatchCommand(Bukkit.getConsoleSender(), "scoreboard teams options AeroCollide collisionRule never");
    }
    t.addEntry(p.getName());
    p.setScoreboard(s);
}
 
开发者ID:Tom7653,项目名称:Aero,代码行数:12,代码来源:Colliding.java

示例5: getScoreboardTeam

import org.bukkit.scoreboard.Scoreboard; //导入方法依赖的package包/类
protected Team getScoreboardTeam() {
	String name = getBukkitEntity().getUniqueId().toString().replace("-", "").substring(0, 16);
	Scoreboard scoreboard = Bukkit.getScoreboardManager().getMainScoreboard();
	Team team = scoreboard.getTeam(name);
	if (team == null) {
		team = scoreboard.registerNewTeam(name);
	}
	return team;
}
 
开发者ID:InventivetalentDev,项目名称:CompactNPCLib,代码行数:10,代码来源:NPCPlayer.java

示例6: get

import org.bukkit.scoreboard.Scoreboard; //导入方法依赖的package包/类
@Override
@Nullable
protected Team[] get(Event e) {
	Scoreboard board = Bukkit.getScoreboardManager().getMainScoreboard();
	if (scoreboard != null) {
		board = scoreboard.getSingle(e);
	}
	if (board.getTeam(team.getSingle(e)) != null) {
		return new Team[]{board.getTeam(team.getSingle(e))};
	}
	return null;
}
 
开发者ID:TheLimeGlass,项目名称:Skellett,代码行数:13,代码来源:ExprGetTeam.java

示例7: execute

import org.bukkit.scoreboard.Scoreboard; //导入方法依赖的package包/类
@Override
protected void execute(Event e) {
	Scoreboard board = Bukkit.getScoreboardManager().getMainScoreboard();
	if (scoreboard != null) {
		board = scoreboard.getSingle(e);
	}
	if (board.getTeam(team.getSingle(e)) != null) {
		return;
	}
	board.registerNewTeam(team.getSingle(e));
}
 
开发者ID:TheLimeGlass,项目名称:Skellett,代码行数:12,代码来源:EffRegisterTeam.java

示例8: createNametag

import org.bukkit.scoreboard.Scoreboard; //导入方法依赖的package包/类
public static void createNametag(String nametag, Scoreboard scoreboard) {
	if(nametag.length() > 16) {
		Bukkit.getConsoleSender().sendMessage(Skellett.cc(Skellett.prefix + "&cA nametag ID name can't have more than 16 characters!"));
           return;
       }
	Scoreboard board = Bukkit.getScoreboardManager().getMainScoreboard();
	if (scoreboard != null) {
		board = scoreboard;
	}
	Team team = board.getTeam(nametag);
	if (team == null) {
		team = board.registerNewTeam(nametag);
	}
}
 
开发者ID:TheLimeGlass,项目名称:Skellett,代码行数:15,代码来源:NametagManager.java

示例9: addPlayer

import org.bukkit.scoreboard.Scoreboard; //导入方法依赖的package包/类
public static void addPlayer(Player player, String nametag, Scoreboard scoreboard) {
	Scoreboard board = Bukkit.getScoreboardManager().getMainScoreboard();
	if (scoreboard != null) {
		board = scoreboard;
	}
	Team team = board.getTeam(nametag);
	if (team == null) {
		Bukkit.getConsoleSender().sendMessage(Skellett.cc(Skellett.prefix + "&cNo nametag under the name " + nametag + " &cwas found!"));
		return;
	}
	team.addEntry(player.getName());
	player.setScoreboard(board);
}
 
开发者ID:TheLimeGlass,项目名称:Skellett,代码行数:14,代码来源:NametagManager.java

示例10: removePlayerNametag

import org.bukkit.scoreboard.Scoreboard; //导入方法依赖的package包/类
@SuppressWarnings("deprecation")
public static void removePlayerNametag(Player player, String nametag) {
	Scoreboard board = Bukkit.getScoreboardManager().getMainScoreboard();
	Team team = board.getTeam(nametag);
	if (team == null) {
		Bukkit.getConsoleSender().sendMessage(Skellett.cc(Skellett.prefix + "&cNo nametag under the name " + nametag + " &cwas found!"));
		return;
	}
	team.removePlayer((OfflinePlayer)player);
}
 
开发者ID:TheLimeGlass,项目名称:Skellett,代码行数:11,代码来源:NametagManager.java

示例11: setNametagPrefix

import org.bukkit.scoreboard.Scoreboard; //导入方法依赖的package包/类
public static void setNametagPrefix(String nametag, String tag) {
	Scoreboard board = Bukkit.getScoreboardManager().getMainScoreboard();
	Team team = board.getTeam(nametag);
	if (team == null) {
		Bukkit.getConsoleSender().sendMessage(Skellett.cc(Skellett.prefix + "&cNo nametag under the name " + nametag + " &cwas found!"));
		return;
	}
	String s = Skellett.cc(tag);
	if(s.length() > 16) {
           s = s.substring(0, 16);
       }
	team.setPrefix(tag);
}
 
开发者ID:TheLimeGlass,项目名称:Skellett,代码行数:14,代码来源:NametagManager.java

示例12: setNametagSuffix

import org.bukkit.scoreboard.Scoreboard; //导入方法依赖的package包/类
public static void setNametagSuffix(String nametag, String tag) {
	Scoreboard board = Bukkit.getScoreboardManager().getMainScoreboard();
	Team team = board.getTeam(nametag);
	if (team == null) {
		Bukkit.getConsoleSender().sendMessage(Skellett.cc(Skellett.prefix + "&cNo nametag under the name " + nametag + " &cwas found!"));
		return;
	}
	String s = Skellett.cc(tag);
	if(s.length() > 16) {
           s = s.substring(0, 16);
       }
	team.setSuffix(tag);
}
 
开发者ID:TheLimeGlass,项目名称:Skellett,代码行数:14,代码来源:NametagManager.java

示例13: resetNametag

import org.bukkit.scoreboard.Scoreboard; //导入方法依赖的package包/类
public static void resetNametag(String nametag) {
	Scoreboard board = Bukkit.getScoreboardManager().getMainScoreboard();
	Team team = board.getTeam(nametag);
	if (team != null) {
		team.setPrefix("");
		team.setSuffix("");
	} else {
		Bukkit.getConsoleSender().sendMessage(Skellett.cc(Skellett.prefix + "&cNo nametag under the name " + nametag + " &cwas found!"));
		return;
	}
}
 
开发者ID:TheLimeGlass,项目名称:Skellett,代码行数:12,代码来源:NametagManager.java

示例14: resetNametagPrefix

import org.bukkit.scoreboard.Scoreboard; //导入方法依赖的package包/类
public static void resetNametagPrefix(String nametag) {
	Scoreboard board = Bukkit.getScoreboardManager().getMainScoreboard();
	Team team = board.getTeam(nametag);
	if (team != null) {
		team.setPrefix("");
	} else {
		Bukkit.getConsoleSender().sendMessage(Skellett.cc(Skellett.prefix + "&cNo nametag under the name " + nametag + " &cwas found!"));
		return;
	}
}
 
开发者ID:TheLimeGlass,项目名称:Skellett,代码行数:11,代码来源:NametagManager.java

示例15: resetNametagSuffix

import org.bukkit.scoreboard.Scoreboard; //导入方法依赖的package包/类
public static void resetNametagSuffix(String nametag) {
	Scoreboard board = Bukkit.getScoreboardManager().getMainScoreboard();
	Team team = board.getTeam(nametag);
	if (team != null) {
		team.setSuffix("");
	} else {
		Bukkit.getConsoleSender().sendMessage(Skellett.cc(Skellett.prefix + "&cNo nametag under the name " + nametag + " &cwas found!"));
		return;
	}
}
 
开发者ID:TheLimeGlass,项目名称:Skellett,代码行数:11,代码来源:NametagManager.java


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