2022-01-10 05:08:55 +00:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
|
|
From: Cryptite <cryptite@gmail.com>
|
|
|
|
Date: Tue, 21 Sep 2021 18:17:34 -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
|
2023-03-31 04:09:13 +00:00
|
|
|
index 2014bca326ec67f178129d8b044fa0b0654e1ffd..376a873ce809fa6ce4dce49d9e00ddbdabb1315e 100644
|
2022-01-10 05:08:55 +00:00
|
|
|
--- a/src/main/java/org/bukkit/scoreboard/Team.java
|
|
|
|
+++ b/src/main/java/org/bukkit/scoreboard/Team.java
|
2022-06-03 05:05:42 +00:00
|
|
|
@@ -323,6 +323,60 @@ public interface Team {
|
2022-01-10 05:08:55 +00:00
|
|
|
*/
|
|
|
|
void addEntry(@NotNull String entry) throws IllegalStateException, IllegalArgumentException;
|
|
|
|
|
|
|
|
+ // Paper start
|
|
|
|
+ /**
|
|
|
|
+ * This puts a collection of entities onto this team for the scoreboard which results in one
|
|
|
|
+ * packet for the updates rather than a packet-per-entity.
|
|
|
|
+ * <p>
|
|
|
|
+ * Entities on other teams will be removed from their respective teams.
|
|
|
|
+ *
|
|
|
|
+ * @param entities the entities to add
|
|
|
|
+ * @throws IllegalArgumentException if entities are null
|
|
|
|
+ * @throws IllegalStateException if this team has been unregistered
|
|
|
|
+ */
|
|
|
|
+ default void addEntities(@NotNull org.bukkit.entity.Entity @NotNull ...entities) {
|
|
|
|
+ this.addEntities(java.util.List.of(entities));
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * This puts a collection of entities onto this team for the scoreboard which results in one
|
|
|
|
+ * packet for the updates rather than a packet-per-entity.
|
|
|
|
+ * <p>
|
|
|
|
+ * Entities on other teams will be removed from their respective teams.
|
|
|
|
+ *
|
|
|
|
+ * @param entities the entities to add
|
|
|
|
+ * @throws IllegalArgumentException if entities are null
|
|
|
|
+ * @throws IllegalStateException if this team has been unregistered
|
|
|
|
+ */
|
|
|
|
+ void addEntities(@NotNull java.util.Collection<org.bukkit.entity.Entity> entities) throws IllegalStateException, IllegalArgumentException;
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 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.
|
|
|
|
+ * <p>
|
|
|
|
+ * 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
|
|
|
|
+ */
|
|
|
|
+ default void addEntries(@NotNull String... entries) throws IllegalStateException, IllegalArgumentException {
|
|
|
|
+ this.addEntries(java.util.List.of(entries));
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 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.
|
|
|
|
+ * <p>
|
|
|
|
+ * 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 java.util.Collection<String> entries) throws IllegalStateException, IllegalArgumentException;
|
|
|
|
+ // Paper end
|
|
|
|
+
|
|
|
|
/**
|
|
|
|
* Removes the player from this team.
|
|
|
|
*
|
2022-06-03 05:05:42 +00:00
|
|
|
@@ -345,6 +399,56 @@ public interface Team {
|
2022-01-10 05:08:55 +00:00
|
|
|
*/
|
|
|
|
boolean removeEntry(@NotNull String entry) throws IllegalStateException, IllegalArgumentException;
|
|
|
|
|
|
|
|
+ // Paper start
|
|
|
|
+ /**
|
2023-03-31 04:09:13 +00:00
|
|
|
+ * Removes a collection of entities from this team which results in one
|
2022-01-10 05:08:55 +00:00
|
|
|
+ * packet for the updates rather than a packet-per-entity.
|
|
|
|
+ *
|
|
|
|
+ * @param entities the entries to remove
|
|
|
|
+ * @return if any of the entities were a part of this team
|
|
|
|
+ * @throws IllegalArgumentException if entities is null
|
|
|
|
+ * @throws IllegalStateException if this team has been unregistered
|
|
|
|
+ */
|
|
|
|
+ default boolean removeEntities(@NotNull org.bukkit.entity.Entity @NotNull ... entities) throws IllegalStateException, IllegalArgumentException {
|
|
|
|
+ return this.removeEntities(java.util.List.of(entities));
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
2023-03-31 04:09:13 +00:00
|
|
|
+ * Removes a collection of entities from this team which results in one
|
2022-01-10 05:08:55 +00:00
|
|
|
+ * packet for the updates rather than a packet-per-entity.
|
|
|
|
+ *
|
|
|
|
+ * @param entities the entries to remove
|
|
|
|
+ * @return if any of the entities were a part of this team
|
|
|
|
+ * @throws IllegalArgumentException if entities is null
|
|
|
|
+ * @throws IllegalStateException if this team has been unregistered
|
|
|
|
+ */
|
|
|
|
+ boolean removeEntities(@NotNull java.util.Collection<org.bukkit.entity.Entity> entities) throws IllegalStateException, IllegalArgumentException;
|
|
|
|
+
|
|
|
|
+ /**
|
2023-03-31 04:09:13 +00:00
|
|
|
+ * Removes a collection of entries from this team which results in one
|
2022-01-10 05:08:55 +00:00
|
|
|
+ * 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 entries is null
|
|
|
|
+ * @throws IllegalStateException if this team has been unregistered
|
|
|
|
+ */
|
|
|
|
+ default boolean removeEntries(@NotNull String... entries) throws IllegalStateException, IllegalArgumentException {
|
|
|
|
+ return this.removeEntries(java.util.List.of(entries));
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
2023-03-31 04:09:13 +00:00
|
|
|
+ * Removes a collection of entries from this team which results in one
|
2022-01-10 05:08:55 +00:00
|
|
|
+ * 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 entries is null
|
|
|
|
+ * @throws IllegalStateException if this team has been unregistered
|
|
|
|
+ */
|
|
|
|
+ boolean removeEntries(@NotNull java.util.Collection<String> entries) throws IllegalStateException, IllegalArgumentException;
|
|
|
|
+ // Paper end
|
|
|
|
+
|
|
|
|
/**
|
|
|
|
* Unregisters this team from the Scoreboard
|
|
|
|
*
|