From 108b422d52e1a1c74cccdd8bbcccd3552f3b7734 Mon Sep 17 00:00:00 2001 From: Bukkit/Spigot Date: Sat, 29 Nov 2014 02:49:19 +0000 Subject: [PATCH] Add NameTag visibility API to the Team interface. By: Adam Thomas --- .../bukkit/scoreboard/NameTagVisibility.java | 21 +++++++++++++++++++ .../main/java/org/bukkit/scoreboard/Team.java | 16 ++++++++++++++ 2 files changed, 37 insertions(+) create mode 100644 paper-api/src/main/java/org/bukkit/scoreboard/NameTagVisibility.java diff --git a/paper-api/src/main/java/org/bukkit/scoreboard/NameTagVisibility.java b/paper-api/src/main/java/org/bukkit/scoreboard/NameTagVisibility.java new file mode 100644 index 0000000000..3137bf6e92 --- /dev/null +++ b/paper-api/src/main/java/org/bukkit/scoreboard/NameTagVisibility.java @@ -0,0 +1,21 @@ +package org.bukkit.scoreboard; + +public enum NameTagVisibility { + + /** + * Always show the player's nametag. + */ + ALWAYS, + /** + * Never show the player's nametag. + */ + NEVER, + /** + * Show the player's nametag only to his own team members. + */ + HIDE_FOR_OTHER_TEAMS, + /** + * Show the player's nametag only to members of other teams. + */ + HIDE_FOR_OWN_TEAM; +} diff --git a/paper-api/src/main/java/org/bukkit/scoreboard/Team.java b/paper-api/src/main/java/org/bukkit/scoreboard/Team.java index 50c6f762e0..e6d144289d 100644 --- a/paper-api/src/main/java/org/bukkit/scoreboard/Team.java +++ b/paper-api/src/main/java/org/bukkit/scoreboard/Team.java @@ -110,6 +110,22 @@ public interface Team { */ void setCanSeeFriendlyInvisibles(boolean enabled) throws IllegalStateException; + /** + * Gets the team's ability to see name tags + * + * @return the current name tag visibilty for the team + * @throws IllegalArgumentException if this team has been unregistered + */ + NameTagVisibility getNameTagVisibility() throws IllegalArgumentException; + + /** + * Set's the team's ability to see name tags + * + * @param visibility The nameTagVisibilty to set + * @throws IllegalArgumentException if this team has been unregistered + */ + void setNameTagVisibility(NameTagVisibility visibility) throws IllegalArgumentException; + /** * Gets the Set of players on the team *