• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java NameTagVisibility类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



NameTagVisibility类属于org.bukkit.scoreboard包,在下文中一共展示了NameTagVisibility类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: refreshScoreboard

import org.bukkit.scoreboard.NameTagVisibility; //导入依赖的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


示例2: initScoreboard

import org.bukkit.scoreboard.NameTagVisibility; //导入依赖的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: create

import org.bukkit.scoreboard.NameTagVisibility; //导入依赖的package包/类
public void create(){
	ScoreboardManager manager = Bukkit.getScoreboardManager();
	board = manager.getNewScoreboard();
	teamRed = board.registerNewTeam("Red");
	teamRed.setNameTagVisibility(NameTagVisibility.HIDE_FOR_OTHER_TEAMS);
	teamRed.setAllowFriendlyFire(false);
	teamGreen = board.registerNewTeam("Green");
	teamGreen.setNameTagVisibility(NameTagVisibility.HIDE_FOR_OTHER_TEAMS);
	teamGreen.setAllowFriendlyFire(false);
	objective = board.registerNewObjective("time", "dummy");
	objective.setDisplaySlot(DisplaySlot.SIDEBAR);
	objective.setDisplayName("Time");
	Score scoreRed = objective.getScore(ChatColor.RED + "Red:");
	scoreRed.setScore(Game.getGame().getCurrentArena().maxPoints);
	Score scoreGreen = objective.getScore(ChatColor.GREEN + "Green:");
	scoreGreen.setScore(Game.getGame().getCurrentArena().maxPoints);
	teamRed.setPrefix(ChatColor.RED.toString());
	teamGreen.setPrefix(ChatColor.GREEN.toString());
	teamRed.setSuffix(ChatColor.WHITE.toString());
	teamGreen.setSuffix(ChatColor.WHITE.toString());
}
 
开发者ID:letsgo00,项目名称:CubeKrowd-Icerunner,代码行数:22,代码来源:Scoreboardmanager.java


示例4: getNameTagVisibility

import org.bukkit.scoreboard.NameTagVisibility; //导入依赖的package包/类
@Override
public NameTagVisibility getNameTagVisibility() throws IllegalArgumentException {
	OptionStatus visibility = getOption(Option.NAME_TAG_VISIBILITY);
	switch (visibility) {
	case ALWAYS:
		return NameTagVisibility.ALWAYS;
	case FOR_OTHER_TEAMS:
		return NameTagVisibility.HIDE_FOR_OTHER_TEAMS;
	case FOR_OWN_TEAM:
		return NameTagVisibility.HIDE_FOR_OWN_TEAM;
	case NEVER:
		return NameTagVisibility.NEVER;
	default:
		throw new RuntimeException("Unknown visibility: " + visibility);
	}
}
 
开发者ID:rutgerkok,项目名称:Pokkit,代码行数:17,代码来源:PokkitTeam.java


示例5: setNameTagVisibility

import org.bukkit.scoreboard.NameTagVisibility; //导入依赖的package包/类
@Override
public void setNameTagVisibility(NameTagVisibility visibility) throws IllegalArgumentException {
	Validate.notNull(visibility, "visibility");
	checkScoreboard();
	switch (visibility) {
	case ALWAYS:
		this.setOption(Option.NAME_TAG_VISIBILITY, OptionStatus.ALWAYS);
		break;
	case HIDE_FOR_OTHER_TEAMS:
		this.setOption(Option.NAME_TAG_VISIBILITY, OptionStatus.FOR_OTHER_TEAMS);
		break;
	case HIDE_FOR_OWN_TEAM:
		this.setOption(Option.NAME_TAG_VISIBILITY, OptionStatus.FOR_OWN_TEAM);
		break;
	case NEVER:
		this.setOption(Option.NAME_TAG_VISIBILITY, OptionStatus.NEVER);
		break;
	default:
		throw new RuntimeException("Unknown name tag visibility: " + visibility);
	}
}
 
开发者ID:rutgerkok,项目名称:Pokkit,代码行数:22,代码来源:PokkitTeam.java


示例6: bukkitToNotch

import org.bukkit.scoreboard.NameTagVisibility; //导入依赖的package包/类
public static EnumNameTagVisibility bukkitToNotch(NameTagVisibility visibility) {
    switch (visibility) {
        case ALWAYS:
            return EnumNameTagVisibility.ALWAYS;
        case NEVER:
            return EnumNameTagVisibility.NEVER;
        case HIDE_FOR_OTHER_TEAMS:
            return EnumNameTagVisibility.HIDE_FOR_OTHER_TEAMS;
        case HIDE_FOR_OWN_TEAM:
            return EnumNameTagVisibility.HIDE_FOR_OWN_TEAM;
        default:
            throw new IllegalArgumentException("Unknown visibility level " + visibility);
    }
}
 
开发者ID:tgnmc,项目名称:Craftbukkit,代码行数:15,代码来源:CraftTeam.java


示例7: notchToBukkit

import org.bukkit.scoreboard.NameTagVisibility; //导入依赖的package包/类
public static NameTagVisibility notchToBukkit(EnumNameTagVisibility visibility) {
    switch (visibility) {
        case ALWAYS:
            return NameTagVisibility.ALWAYS;
        case NEVER:
            return NameTagVisibility.NEVER;
        case HIDE_FOR_OTHER_TEAMS:
            return NameTagVisibility.HIDE_FOR_OTHER_TEAMS;
        case HIDE_FOR_OWN_TEAM:
            return NameTagVisibility.HIDE_FOR_OWN_TEAM;
        default:
            throw new IllegalArgumentException("Unknown visibility level " + visibility);
    }
}
 
开发者ID:tgnmc,项目名称:Craftbukkit,代码行数:15,代码来源:CraftTeam.java


示例8: setTeamNameTagVisibility

import org.bukkit.scoreboard.NameTagVisibility; //导入依赖的package包/类
/**
 * Set the team name tag visibility of a team by team name.
 * 
 * @param team The reference name of the team.
 * @param vis The NameTagVisibility object to be set.
 */
public void setTeamNameTagVisibility(String team, NameTagVisibility vis) {
  if (teamMap.containsKey(team)) {
    teamMap.get(team).setNameTagVisibility(vis);
    for (Object p : Bukkit.getServer().getOnlinePlayers().toArray()) {
      // Debug
      Bukkit.broadcastMessage("Friendly Invisibles set!");
      ((Player) p).getScoreboard().getTeam(team).setNameTagVisibility(vis);
    }
  }
}
 
开发者ID:eyesniper2,项目名称:skRayFall,代码行数:17,代码来源:TeamManager.java


示例9: getNameTagVisibility

import org.bukkit.scoreboard.NameTagVisibility; //导入依赖的package包/类
@Override
public NameTagVisibility getNameTagVisibility() throws IllegalArgumentException {
    return null;
}
 
开发者ID:lukas81298,项目名称:FlexMC,代码行数:5,代码来源:FlexTeam.java


示例10: getNameTagVisibility

import org.bukkit.scoreboard.NameTagVisibility; //导入依赖的package包/类
public NameTagVisibility getNameTagVisibility() throws IllegalArgumentException {
    throw new NotImplementedException("getNameTagVisibility()");
}
 
开发者ID:CanaryBukkitTeam,项目名称:CanaryBukkit,代码行数:4,代码来源:CanaryTeam.java


示例11: setNameTagVisibility

import org.bukkit.scoreboard.NameTagVisibility; //导入依赖的package包/类
public void setNameTagVisibility(NameTagVisibility nameTagVisibility) throws IllegalArgumentException {
    throw new NotImplementedException("setNameTagVisibility(NameTagVisibility)");
}
 
开发者ID:CanaryBukkitTeam,项目名称:CanaryBukkit,代码行数:4,代码来源:CanaryTeam.java


示例12: getNameTagVisibility

import org.bukkit.scoreboard.NameTagVisibility; //导入依赖的package包/类
public NameTagVisibility getNameTagVisibility() throws IllegalArgumentException {
    CraftScoreboard scoreboard = checkState();

    return notchToBukkit(team.getNameTagVisibility());
}
 
开发者ID:tgnmc,项目名称:Craftbukkit,代码行数:6,代码来源:CraftTeam.java


示例13: setNameTagVisibility

import org.bukkit.scoreboard.NameTagVisibility; //导入依赖的package包/类
public void setNameTagVisibility(NameTagVisibility visibility) throws IllegalArgumentException {
    CraftScoreboard scoreboard = checkState();

    team.setNameTagVisibility(bukkitToNotch(visibility));
}
 
开发者ID:tgnmc,项目名称:Craftbukkit,代码行数:6,代码来源:CraftTeam.java


示例14: of

import org.bukkit.scoreboard.NameTagVisibility; //导入依赖的package包/类
public static Visibility of(NameTagVisibility slot) {
    return CONVERTER.convert(slot);
}
 
开发者ID:LapisBlue,项目名称:Pore,代码行数:4,代码来源:NameTagVisibilityConverter.java


示例15: getNameTagVisibility

import org.bukkit.scoreboard.NameTagVisibility; //导入依赖的package包/类
@Override
public NameTagVisibility getNameTagVisibility() throws IllegalArgumentException {
    checkState(); // this is technically against documentation but the documentation is stupid for this method
    return NameTagVisibilityConverter.of(getHandle().getNameTagVisibility());
}
 
开发者ID:LapisBlue,项目名称:Pore,代码行数:6,代码来源:PoreTeam.java


示例16: setNameTagVisibility

import org.bukkit.scoreboard.NameTagVisibility; //导入依赖的package包/类
@Override
public void setNameTagVisibility(NameTagVisibility visibility) throws IllegalArgumentException {
    checkState(); // same for this
    checkArgument(visibility != null, "Visibility cannot be null");
    getHandle().setNameTagVisibility(NameTagVisibilityConverter.of(visibility));
}
 
开发者ID:LapisBlue,项目名称:Pore,代码行数:7,代码来源:PoreTeam.java


示例17: getNameTagVisibility

import org.bukkit.scoreboard.NameTagVisibility; //导入依赖的package包/类
@Override
public NameTagVisibility getNameTagVisibility() {
    return _team.getNameTagVisibility();
}
 
开发者ID:JCThePants,项目名称:NucleusFramework,代码行数:5,代码来源:ManagedTeam.java


示例18: setNameTagVisibility

import org.bukkit.scoreboard.NameTagVisibility; //导入依赖的package包/类
@Override
public void setNameTagVisibility(NameTagVisibility nameTagVisibility) {
    _team.setNameTagVisibility(nameTagVisibility);
}
 
开发者ID:JCThePants,项目名称:NucleusFramework,代码行数:5,代码来源:ManagedTeam.java


示例19: setNameTagVisibility

import org.bukkit.scoreboard.NameTagVisibility; //导入依赖的package包/类
@Override
public void setNameTagVisibility( NameTagVisibility nameTagVisibility ) throws IllegalArgumentException {

}
 
开发者ID:lukas81298,项目名称:FlexMC,代码行数:5,代码来源:FlexTeam.java


示例20: getNameTagVisibility

import org.bukkit.scoreboard.NameTagVisibility; //导入依赖的package包/类
/**
 * Get name tag visibility.
 */
NameTagVisibility getNameTagVisibility();
 
开发者ID:JCThePants,项目名称:NucleusFramework,代码行数:5,代码来源:ITeam.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java AbstractGridFormat类代码示例发布时间:2022-05-22
下一篇:
Java Actionable类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap