Fix some team color docs and added hasColor (#7602)

This commit is contained in:
Jake Potrebic 2022-04-23 18:37:10 -07:00 committed by GitHub
parent 5b85ee37e2
commit 4dc78ae8b9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 46 additions and 30 deletions

View file

@ -4052,10 +4052,10 @@ index 5c855dbd0da895392f7a6e92cdc90782baf614ad..1ada91d790abedbc9b3aeb6e96467a0d
/**
diff --git a/src/main/java/org/bukkit/scoreboard/Team.java b/src/main/java/org/bukkit/scoreboard/Team.java
index 0db7fe1b9fe5621ceed3f4f046691e359f5949dd..d5b39fb4fc16a342b5661e08df1506858168d20d 100644
index 0db7fe1b9fe5621ceed3f4f046691e359f5949dd..07a9fa68075a2c5f5a4a7519976b506526d95ca0 100644
--- a/src/main/java/org/bukkit/scoreboard/Team.java
+++ b/src/main/java/org/bukkit/scoreboard/Team.java
@@ -22,14 +22,93 @@ public interface Team {
@@ -22,14 +22,102 @@ public interface Team {
*/
@NotNull
String getName() throws IllegalStateException;
@ -4115,13 +4115,23 @@ index 0db7fe1b9fe5621ceed3f4f046691e359f5949dd..d5b39fb4fc16a342b5661e08df150685
+ void suffix(@Nullable net.kyori.adventure.text.Component suffix) throws IllegalStateException, IllegalArgumentException;
+
+ /**
+ * Checks if the team has a color specified
+ *
+ * @return true if it has a <b>color</b>
+ * @throws IllegalStateException if this team has been unregistered
+ */
+ boolean hasColor();
+
+ /**
+ * Gets the color of the team.
+ * <br>
+ * This only sets the team outline, other occurrences of colors such as in
+ * names are handled by prefixes / suffixes.
+ *
+ * @return team color, defaults to {@link ChatColor#RESET}
+ * @return team color
+ * @throws IllegalStateException if this team has been unregistered
+ * @throws IllegalStateException if the team doesn't have a color
+ * @see #hasColor()
+ */
+ @NotNull net.kyori.adventure.text.format.TextColor color() throws IllegalStateException;
+
@ -4131,8 +4141,7 @@ index 0db7fe1b9fe5621ceed3f4f046691e359f5949dd..d5b39fb4fc16a342b5661e08df150685
+ * This only sets the team outline, other occurrences of colors such as in
+ * names are handled by prefixes / suffixes.
+ *
+ * @param color new color, must be non-null. Use {@link ChatColor#RESET} for
+ * no color
+ * @param color new color, null for no color
+ */
+ void color(@Nullable net.kyori.adventure.text.format.NamedTextColor color);
+ // Paper end
@ -4149,7 +4158,7 @@ index 0db7fe1b9fe5621ceed3f4f046691e359f5949dd..d5b39fb4fc16a342b5661e08df150685
String getDisplayName() throws IllegalStateException;
/**
@@ -39,7 +118,9 @@ public interface Team {
@@ -39,7 +127,9 @@ public interface Team {
* @throws IllegalArgumentException if displayName is longer than 128
* characters.
* @throws IllegalStateException if this team has been unregistered
@ -4159,7 +4168,7 @@ index 0db7fe1b9fe5621ceed3f4f046691e359f5949dd..d5b39fb4fc16a342b5661e08df150685
void setDisplayName(@NotNull String displayName) throws IllegalStateException, IllegalArgumentException;
/**
@@ -47,8 +128,10 @@ public interface Team {
@@ -47,8 +137,10 @@ public interface Team {
*
* @return Team prefix
* @throws IllegalStateException if this team has been unregistered
@ -4170,7 +4179,7 @@ index 0db7fe1b9fe5621ceed3f4f046691e359f5949dd..d5b39fb4fc16a342b5661e08df150685
String getPrefix() throws IllegalStateException;
/**
@@ -59,7 +142,9 @@ public interface Team {
@@ -59,7 +151,9 @@ public interface Team {
* @throws IllegalArgumentException if prefix is longer than 64
* characters
* @throws IllegalStateException if this team has been unregistered
@ -4180,7 +4189,7 @@ index 0db7fe1b9fe5621ceed3f4f046691e359f5949dd..d5b39fb4fc16a342b5661e08df150685
void setPrefix(@NotNull String prefix) throws IllegalStateException, IllegalArgumentException;
/**
@@ -67,8 +152,10 @@ public interface Team {
@@ -67,8 +161,10 @@ public interface Team {
*
* @return the team's current suffix
* @throws IllegalStateException if this team has been unregistered
@ -4191,7 +4200,7 @@ index 0db7fe1b9fe5621ceed3f4f046691e359f5949dd..d5b39fb4fc16a342b5661e08df150685
String getSuffix() throws IllegalStateException;
/**
@@ -79,7 +166,9 @@ public interface Team {
@@ -79,7 +175,9 @@ public interface Team {
* @throws IllegalArgumentException if suffix is longer than 64
* characters
* @throws IllegalStateException if this team has been unregistered
@ -4201,7 +4210,7 @@ index 0db7fe1b9fe5621ceed3f4f046691e359f5949dd..d5b39fb4fc16a342b5661e08df150685
void setSuffix(@NotNull String suffix) throws IllegalStateException, IllegalArgumentException;
/**
@@ -90,8 +179,10 @@ public interface Team {
@@ -90,8 +188,10 @@ public interface Team {
*
* @return team color, defaults to {@link ChatColor#RESET}
* @throws IllegalStateException if this team has been unregistered
@ -4212,7 +4221,7 @@ index 0db7fe1b9fe5621ceed3f4f046691e359f5949dd..d5b39fb4fc16a342b5661e08df150685
ChatColor getColor() throws IllegalStateException;
/**
@@ -102,7 +193,9 @@ public interface Team {
@@ -102,7 +202,9 @@ public interface Team {
*
* @param color new color, must be non-null. Use {@link ChatColor#RESET} for
* no color