本文整理汇总了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;
}
示例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;
}
示例3: VisibilityRegistryModule
import org.spongepowered.api.scoreboard.Visibilities; //导入依赖的package包/类
public VisibilityRegistryModule() {
super(Visibilities.class);
}