Fix some team color docs and added hasColor (#7602)
This commit is contained in:
parent
5b85ee37e2
commit
4dc78ae8b9
7 changed files with 46 additions and 30 deletions
|
@ -3385,10 +3385,10 @@ index afc059755ae3e7b1c0a4cf3c6b8f32ce13cc458d..5f2af880619e01a03e05258ae1f9fa58
|
|||
|
||||
@Override
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftTeam.java b/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftTeam.java
|
||||
index 81f16dc1ed6e102af298600db75cab21a09bc00f..f86776aa42bd5520f8aaeaa46bb93ec4d5b4e27d 100644
|
||||
index 81f16dc1ed6e102af298600db75cab21a09bc00f..df1288e2e89716bba5ef73d2cdeb9a567f46a297 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftTeam.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftTeam.java
|
||||
@@ -28,6 +28,55 @@ final class CraftTeam extends CraftScoreboardComponent implements Team {
|
||||
@@ -28,6 +28,62 @@ final class CraftTeam extends CraftScoreboardComponent implements Team {
|
||||
|
||||
return this.team.getName();
|
||||
}
|
||||
|
@ -3427,6 +3427,11 @@ index 81f16dc1ed6e102af298600db75cab21a09bc00f..f86776aa42bd5520f8aaeaa46bb93ec4
|
|||
+ team.setPlayerSuffix(io.papermc.paper.adventure.PaperAdventure.asVanilla(suffix));
|
||||
+ }
|
||||
+ @Override
|
||||
+ public boolean hasColor() {
|
||||
+ CraftScoreboard scoreboard = checkState();
|
||||
+ return this.team.getColor().getColor() != null;
|
||||
+ }
|
||||
+ @Override
|
||||
+ public net.kyori.adventure.text.format.TextColor color() throws IllegalStateException {
|
||||
+ CraftScoreboard scoreboard = checkState();
|
||||
+ if (team.getColor().getColor() == null) throw new IllegalStateException("Team colors must have hex values");
|
||||
|
@ -3436,8 +3441,10 @@ index 81f16dc1ed6e102af298600db75cab21a09bc00f..f86776aa42bd5520f8aaeaa46bb93ec4
|
|||
+ }
|
||||
+ @Override
|
||||
+ public void color(net.kyori.adventure.text.format.NamedTextColor color) {
|
||||
+ if (color == null) color = net.kyori.adventure.text.format.NamedTextColor.WHITE;
|
||||
+ CraftScoreboard scoreboard = checkState();
|
||||
+ if (color == null) {
|
||||
+ this.team.setColor(net.minecraft.ChatFormatting.RESET);
|
||||
+ }
|
||||
+ team.setColor(io.papermc.paper.adventure.PaperAdventure.asVanilla(color));
|
||||
+ }
|
||||
+ // Paper end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue