geforkt von Mirrors/Paper
Make Team extend ForwardingAudience (#9852)
Dieser Commit ist enthalten in:
Ursprung
d1c10d63dc
Commit
5cfbe38b31
@ -4811,6 +4811,15 @@ diff --git a/src/main/java/org/bukkit/scoreboard/Team.java b/src/main/java/org/b
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/org/bukkit/scoreboard/Team.java
|
||||
+++ b/src/main/java/org/bukkit/scoreboard/Team.java
|
||||
@@ -0,0 +0,0 @@ import org.jetbrains.annotations.Nullable;
|
||||
* properties. This team is only relevant to the display of the associated
|
||||
* {@link #getScoreboard() scoreboard}.
|
||||
*/
|
||||
-public interface Team {
|
||||
+public interface Team extends net.kyori.adventure.audience.ForwardingAudience { // Paper - Make Team extend ForwardingAudience
|
||||
|
||||
/**
|
||||
* Gets the name of this Team
|
||||
@@ -0,0 +0,0 @@ public interface Team {
|
||||
@NotNull
|
||||
String getName();
|
||||
|
@ -1232,7 +1232,7 @@ diff --git a/src/main/java/org/bukkit/scoreboard/Team.java b/src/main/java/org/b
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/org/bukkit/scoreboard/Team.java
|
||||
+++ b/src/main/java/org/bukkit/scoreboard/Team.java
|
||||
@@ -0,0 +0,0 @@ public interface Team {
|
||||
@@ -0,0 +0,0 @@ public interface Team extends net.kyori.adventure.audience.ForwardingAudience {
|
||||
* Gets the Set of entries on the team
|
||||
*
|
||||
* @return entries on the team
|
||||
|
@ -113,7 +113,7 @@ diff --git a/src/main/java/org/bukkit/scoreboard/Team.java b/src/main/java/org/b
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/org/bukkit/scoreboard/Team.java
|
||||
+++ b/src/main/java/org/bukkit/scoreboard/Team.java
|
||||
@@ -0,0 +0,0 @@ public interface Team {
|
||||
@@ -0,0 +0,0 @@ public interface Team extends net.kyori.adventure.audience.ForwardingAudience {
|
||||
* @param player the player to add
|
||||
* @throws IllegalStateException if this team has been unregistered
|
||||
* @see #addEntry(String)
|
||||
@ -124,7 +124,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
void addPlayer(@NotNull OfflinePlayer player);
|
||||
|
||||
/**
|
||||
@@ -0,0 +0,0 @@ public interface Team {
|
||||
@@ -0,0 +0,0 @@ public interface Team extends net.kyori.adventure.audience.ForwardingAudience {
|
||||
* @return if the player was on this team
|
||||
* @throws IllegalStateException if this team has been unregistered
|
||||
* @see #removeEntry(String)
|
||||
@ -135,7 +135,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
boolean removePlayer(@NotNull OfflinePlayer player);
|
||||
|
||||
/**
|
||||
@@ -0,0 +0,0 @@ public interface Team {
|
||||
@@ -0,0 +0,0 @@ public interface Team extends net.kyori.adventure.audience.ForwardingAudience {
|
||||
* @return true if the player is a member of this team
|
||||
* @throws IllegalStateException if this team has been unregistered
|
||||
* @see #hasEntry(String)
|
||||
@ -146,7 +146,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
boolean hasPlayer(@NotNull OfflinePlayer player);
|
||||
/**
|
||||
* Checks to see if the specified entry is a member of this team.
|
||||
@@ -0,0 +0,0 @@ public interface Team {
|
||||
@@ -0,0 +0,0 @@ public interface Team extends net.kyori.adventure.audience.ForwardingAudience {
|
||||
*/
|
||||
void setOption(@NotNull Option option, @NotNull OptionStatus status);
|
||||
|
||||
|
@ -8,7 +8,7 @@ diff --git a/src/main/java/org/bukkit/scoreboard/Team.java b/src/main/java/org/b
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/org/bukkit/scoreboard/Team.java
|
||||
+++ b/src/main/java/org/bukkit/scoreboard/Team.java
|
||||
@@ -0,0 +0,0 @@ public interface Team {
|
||||
@@ -0,0 +0,0 @@ public interface Team extends net.kyori.adventure.audience.ForwardingAudience {
|
||||
*/
|
||||
void addEntry(@NotNull String entry);
|
||||
|
||||
@ -69,7 +69,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
/**
|
||||
* Removes the player from this team.
|
||||
*
|
||||
@@ -0,0 +0,0 @@ public interface Team {
|
||||
@@ -0,0 +0,0 @@ public interface Team extends net.kyori.adventure.audience.ForwardingAudience {
|
||||
*/
|
||||
boolean removeEntry(@NotNull String entry);
|
||||
|
||||
|
@ -4895,6 +4895,27 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
|
||||
@Override
|
||||
public String getDisplayName() {
|
||||
@@ -0,0 +0,0 @@ final class CraftTeam extends CraftScoreboardComponent implements Team {
|
||||
return !(this.team != other.team && (this.team == null || !this.team.equals(other.team)));
|
||||
}
|
||||
|
||||
+ // Paper start - make Team extend ForwardingAudience
|
||||
+ @Override
|
||||
+ public @org.jetbrains.annotations.NotNull Iterable<? extends net.kyori.adventure.audience.Audience> audiences() {
|
||||
+ this.checkState();
|
||||
+ java.util.List<net.kyori.adventure.audience.Audience> audiences = new java.util.ArrayList<>();
|
||||
+ for (String playerName : this.team.getPlayers()) {
|
||||
+ org.bukkit.entity.Player player = Bukkit.getPlayerExact(playerName);
|
||||
+ if (player != null) {
|
||||
+ audiences.add(player);
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ return audiences;
|
||||
+ }
|
||||
+ // Paper end - make Team extend ForwardingAudience
|
||||
+
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftChatMessage.java b/src/main/java/org/bukkit/craftbukkit/util/CraftChatMessage.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftChatMessage.java
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren