diff options
author | md_5 <git@md-5.net> | 2016-03-03 19:06:52 +1100 |
---|---|---|
committer | md_5 <git@md-5.net> | 2016-03-04 15:23:18 +1100 |
commit | f8573a0ca2e384e889832dc30ed41712e046fd30 (patch) | |
tree | af3c1b567d9d0c47ba8332cbb0e00d3d316e95cb /src/main | |
parent | 325dae0d06bbce001d246884b3724f8df3d0eb65 (diff) | |
download | bukkit-f8573a0ca2e384e889832dc30ed41712e046fd30.tar bukkit-f8573a0ca2e384e889832dc30ed41712e046fd30.tar.gz bukkit-f8573a0ca2e384e889832dc30ed41712e046fd30.tar.lz bukkit-f8573a0ca2e384e889832dc30ed41712e046fd30.tar.xz bukkit-f8573a0ca2e384e889832dc30ed41712e046fd30.zip |
SPIGOT-1666: Expand Team option API
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/java/org/bukkit/scoreboard/NameTagVisibility.java | 4 | ||||
-rw-r--r-- | src/main/java/org/bukkit/scoreboard/Team.java | 67 |
2 files changed, 70 insertions, 1 deletions
diff --git a/src/main/java/org/bukkit/scoreboard/NameTagVisibility.java b/src/main/java/org/bukkit/scoreboard/NameTagVisibility.java index 3137bf6e..d9e9ae1a 100644 --- a/src/main/java/org/bukkit/scoreboard/NameTagVisibility.java +++ b/src/main/java/org/bukkit/scoreboard/NameTagVisibility.java @@ -1,5 +1,9 @@ package org.bukkit.scoreboard; +/** + * @deprecated replaced by {@link Team.OptionStatus} + */ +@Deprecated public enum NameTagVisibility { /** diff --git a/src/main/java/org/bukkit/scoreboard/Team.java b/src/main/java/org/bukkit/scoreboard/Team.java index 0fdcebd9..bddc8482 100644 --- a/src/main/java/org/bukkit/scoreboard/Team.java +++ b/src/main/java/org/bukkit/scoreboard/Team.java @@ -115,7 +115,9 @@ public interface Team { * * @return the current name tag visibilty for the team * @throws IllegalArgumentException if this team has been unregistered + * @deprecated see {@link #getOption()} */ + @Deprecated NameTagVisibility getNameTagVisibility() throws IllegalArgumentException; /** @@ -123,7 +125,10 @@ public interface Team { * * @param visibility The nameTagVisibilty to set * @throws IllegalArgumentException if this team has been unregistered + * @deprecated see + * {@link #setOption(org.bukkit.scoreboard.Team.Option, org.bukkit.scoreboard.Team.OptionStatus)} */ + @Deprecated void setNameTagVisibility(NameTagVisibility visibility) throws IllegalArgumentException; /** @@ -236,5 +241,65 @@ public interface Team { * @throws IllegalArgumentException if entry is null * @throws IllegalStateException if this team has been unregistered */ - boolean hasEntry(String entry) throws IllegalArgumentException,IllegalStateException; + boolean hasEntry(String entry) throws IllegalArgumentException, IllegalStateException; + + /** + * Get an option for this team + * + * @param option the option to get + * @return the option status + * @throws IllegalStateException if this team has been unregistered + */ + OptionStatus getOption(Option option) throws IllegalStateException; + + /** + * Set an option for this team + * + * @param option the option to set + * @param status the new option status + * @throws IllegalStateException if this team has been unregistered + */ + void setOption(Option option, OptionStatus status) throws IllegalStateException; + + /** + * Represents an option which may be applied to this team. + */ + public enum Option { + + /** + * How to display the name tags of players on this team. + */ + NAME_TAG_VISIBILITY, + /** + * How to display the death messages for players on this team. + */ + DEATH_MESSAGE_VISIBILITY, + /** + * How players of this team collide with others. + */ + COLLISION_RULE; + } + + /** + * How an option may be applied to members of this team. + */ + public enum OptionStatus { + + /** + * Apply this option to everyone. + */ + ALWAYS, + /** + * Never apply this option. + */ + NEVER, + /** + * Apply this option only for opposing teams. + */ + FOR_OTHER_TEAMS, + /** + * Apply this option for only team members. + */ + FOR_OWN_TEAM; + } } |