From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Cryptite Date: Tue, 21 Sep 2021 15:20:16 -0500 Subject: [PATCH] Multiple Entries with Scoreboards diff --git a/src/main/java/org/bukkit/scoreboard/Team.java b/src/main/java/org/bukkit/scoreboard/Team.java index d5b39fb4fc16a342b5661e08df1506858168d20d..9ec00b045fe85701ce29c0ad10eb9921733107b3 100644 --- a/src/main/java/org/bukkit/scoreboard/Team.java +++ b/src/main/java/org/bukkit/scoreboard/Team.java @@ -1,5 +1,6 @@ package org.bukkit.scoreboard; +import java.util.Collection; // Paper import java.util.Set; import org.bukkit.ChatColor; import org.bukkit.OfflinePlayer; @@ -317,6 +318,20 @@ public interface Team { */ void addEntry(@NotNull String entry) throws IllegalStateException, IllegalArgumentException; + // Paper start + /** + * This puts a collection of entries onto this team for the scoreboard which results in one + * packet for the updates rather than a packet-per-entry. + *

+ * Entries on other teams will be removed from their respective teams. + * + * @param entries the entries to add + * @throws IllegalArgumentException if entries are null + * @throws IllegalStateException if this team has been unregistered + */ + void addEntries(@NotNull Collection entries) throws IllegalStateException, IllegalArgumentException; + // Paper end + /** * Removes the player from this team. * @@ -340,6 +355,19 @@ public interface Team { */ boolean removeEntry(@NotNull String entry) throws IllegalStateException, IllegalArgumentException; + // Paper start + /** + * Removes a collection of entries from this team which results in one + * packet for the updates rather than a packet-per-entry. + * + * @param entries the entries to remove + * @return if any of the entries were a part of this team + * @throws IllegalArgumentException if entry is null + * @throws IllegalStateException if this team has been unregistered + */ + boolean removeEntries(@NotNull Collection entries) throws IllegalStateException, IllegalArgumentException; + // Paper end + /** * Unregisters this team from the Scoreboard *