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


Java Visibilities类代码示例

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


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

示例1: sendNameTag

import org.spongepowered.api.scoreboard.Visibilities; //导入依赖的package包/类
private boolean sendNameTag(EPlayer player, Text teamRepresentation, Text prefix, Text suffix) {		
	Team team = Team.builder()
			.prefix(EChat.fixLength(prefix, MAX_CHARACTERS))
			.suffix(EChat.fixLength(suffix, MAX_CHARACTERS))
			.name(teamRepresentation.toPlain())
			.nameTagVisibility(Visibilities.ALWAYS)
			.collisionRule(CollisionRules.NEVER)
			.displayName(teamRepresentation)
			.color(TextColors.RED)
			.allowFriendlyFire(true)
			.build();
	team.addMember(teamRepresentation);
	try {
		player.getScoreboard().registerTeam(team);
	} catch (IllegalArgumentException e) {
		this.plugin.getELogger().warn("[NameTagService] sendNameTag : ("
				+ "player='" + player.getName() + "';"
				+ "team='" + EChat.serialize(teamRepresentation) + "';"
				+ "prefix='" + EChat.serialize(prefix) + "';"
				+ "suffix='" + EChat.serialize(suffix) + "')");
		e.printStackTrace();
	}
	return true;
}
 
开发者ID:EverCraft,项目名称:EverAPI,代码行数:25,代码来源:ENameTagService.java

示例2: reset

import org.spongepowered.api.scoreboard.Visibilities; //导入依赖的package包/类
@Override
public LanternTeamBuilder reset() {
    this.name = null;
    this.displayName = null;
    this.color = TextColors.NONE;
    this.prefix = Text.of();
    this.suffix = Text.of();
    this.allowFriendlyFire = false;
    this.showFriendlyInvisibles = false;
    this.nameTagVisibility = Visibilities.ALWAYS;
    this.deathMessageVisibility = Visibilities.ALWAYS;
    this.collisionRule = CollisionRules.NEVER;
    this.members = new HashSet<>();
    return this;
}
 
开发者ID:LanternPowered,项目名称:LanternServer,代码行数:16,代码来源:LanternTeamBuilder.java

示例3: VisibilityRegistryModule

import org.spongepowered.api.scoreboard.Visibilities; //导入依赖的package包/类
public VisibilityRegistryModule() {
    super(Visibilities.class);
}
 
开发者ID:LanternPowered,项目名称:LanternServer,代码行数:4,代码来源:VisibilityRegistryModule.java


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