|
| 1 | +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 |
| 2 | +From: Cryptite <cryptite@gmail.com> |
| 3 | +Date: Tue, 21 Sep 2021 18:17:34 -0500 |
| 4 | +Subject: [PATCH] Multiple Entries with Scoreboards |
| 5 | + |
| 6 | + |
| 7 | +diff --git a/src/main/java/org/bukkit/scoreboard/Team.java b/src/main/java/org/bukkit/scoreboard/Team.java |
| 8 | +index 2b93692204a74ea0def513a54ddf77a40c64d3d2..04c8cc55a2fe19c888aba842775cc66648dddb0c 100644 |
| 9 | +--- a/src/main/java/org/bukkit/scoreboard/Team.java |
| 10 | ++++ b/src/main/java/org/bukkit/scoreboard/Team.java |
| 11 | +@@ -316,6 +316,60 @@ public interface Team { |
| 12 | + */ |
| 13 | + void addEntry(@NotNull String entry) throws IllegalStateException, IllegalArgumentException; |
| 14 | + |
| 15 | ++ // Paper start |
| 16 | ++ /** |
| 17 | ++ * This puts a collection of entities onto this team for the scoreboard which results in one |
| 18 | ++ * packet for the updates rather than a packet-per-entity. |
| 19 | ++ * <p> |
| 20 | ++ * Entities on other teams will be removed from their respective teams. |
| 21 | ++ * |
| 22 | ++ * @param entities the entities to add |
| 23 | ++ * @throws IllegalArgumentException if entities are null |
| 24 | ++ * @throws IllegalStateException if this team has been unregistered |
| 25 | ++ */ |
| 26 | ++ default void addEntities(@NotNull org.bukkit.entity.Entity @NotNull ...entities) { |
| 27 | ++ this.addEntities(java.util.List.of(entities)); |
| 28 | ++ } |
| 29 | ++ |
| 30 | ++ /** |
| 31 | ++ * This puts a collection of entities onto this team for the scoreboard which results in one |
| 32 | ++ * packet for the updates rather than a packet-per-entity. |
| 33 | ++ * <p> |
| 34 | ++ * Entities on other teams will be removed from their respective teams. |
| 35 | ++ * |
| 36 | ++ * @param entities the entities to add |
| 37 | ++ * @throws IllegalArgumentException if entities are null |
| 38 | ++ * @throws IllegalStateException if this team has been unregistered |
| 39 | ++ */ |
| 40 | ++ void addEntities(@NotNull java.util.Collection<org.bukkit.entity.Entity> entities) throws IllegalStateException, IllegalArgumentException; |
| 41 | ++ |
| 42 | ++ /** |
| 43 | ++ * This puts a collection of entries onto this team for the scoreboard which results in one |
| 44 | ++ * packet for the updates rather than a packet-per-entry. |
| 45 | ++ * <p> |
| 46 | ++ * Entries on other teams will be removed from their respective teams. |
| 47 | ++ * |
| 48 | ++ * @param entries the entries to add |
| 49 | ++ * @throws IllegalArgumentException if entries are null |
| 50 | ++ * @throws IllegalStateException if this team has been unregistered |
| 51 | ++ */ |
| 52 | ++ default void addEntries(@NotNull String... entries) throws IllegalStateException, IllegalArgumentException { |
| 53 | ++ this.addEntries(java.util.List.of(entries)); |
| 54 | ++ } |
| 55 | ++ |
| 56 | ++ /** |
| 57 | ++ * This puts a collection of entries onto this team for the scoreboard which results in one |
| 58 | ++ * packet for the updates rather than a packet-per-entry. |
| 59 | ++ * <p> |
| 60 | ++ * Entries on other teams will be removed from their respective teams. |
| 61 | ++ * |
| 62 | ++ * @param entries the entries to add |
| 63 | ++ * @throws IllegalArgumentException if entries are null |
| 64 | ++ * @throws IllegalStateException if this team has been unregistered |
| 65 | ++ */ |
| 66 | ++ void addEntries(@NotNull java.util.Collection<String> entries) throws IllegalStateException, IllegalArgumentException; |
| 67 | ++ // Paper end |
| 68 | ++ |
| 69 | + /** |
| 70 | + * Removes the player from this team. |
| 71 | + * |
| 72 | +@@ -338,6 +392,56 @@ public interface Team { |
| 73 | + */ |
| 74 | + boolean removeEntry(@NotNull String entry) throws IllegalStateException, IllegalArgumentException; |
| 75 | + |
| 76 | ++ // Paper start |
| 77 | ++ /** |
| 78 | ++ * Removes a collection of entities from this team which results in one |
| 79 | ++ * packet for the updates rather than a packet-per-entity. |
| 80 | ++ * |
| 81 | ++ * @param entities the entries to remove |
| 82 | ++ * @return if any of the entities were a part of this team |
| 83 | ++ * @throws IllegalArgumentException if entities is null |
| 84 | ++ * @throws IllegalStateException if this team has been unregistered |
| 85 | ++ */ |
| 86 | ++ default boolean removeEntities(@NotNull org.bukkit.entity.Entity @NotNull ... entities) throws IllegalStateException, IllegalArgumentException { |
| 87 | ++ return this.removeEntities(java.util.List.of(entities)); |
| 88 | ++ } |
| 89 | ++ |
| 90 | ++ /** |
| 91 | ++ * Removes a collection of entities from this team which results in one |
| 92 | ++ * packet for the updates rather than a packet-per-entity. |
| 93 | ++ * |
| 94 | ++ * @param entities the entries to remove |
| 95 | ++ * @return if any of the entities were a part of this team |
| 96 | ++ * @throws IllegalArgumentException if entities is null |
| 97 | ++ * @throws IllegalStateException if this team has been unregistered |
| 98 | ++ */ |
| 99 | ++ boolean removeEntities(@NotNull java.util.Collection<org.bukkit.entity.Entity> entities) throws IllegalStateException, IllegalArgumentException; |
| 100 | ++ |
| 101 | ++ /** |
| 102 | ++ * Removes a collection of entries from this team which results in one |
| 103 | ++ * packet for the updates rather than a packet-per-entry. |
| 104 | ++ * |
| 105 | ++ * @param entries the entries to remove |
| 106 | ++ * @return if any of the entries were a part of this team |
| 107 | ++ * @throws IllegalArgumentException if entries is null |
| 108 | ++ * @throws IllegalStateException if this team has been unregistered |
| 109 | ++ */ |
| 110 | ++ default boolean removeEntries(@NotNull String... entries) throws IllegalStateException, IllegalArgumentException { |
| 111 | ++ return this.removeEntries(java.util.List.of(entries)); |
| 112 | ++ } |
| 113 | ++ |
| 114 | ++ /** |
| 115 | ++ * Removes a collection of entries from this team which results in one |
| 116 | ++ * packet for the updates rather than a packet-per-entry. |
| 117 | ++ * |
| 118 | ++ * @param entries the entries to remove |
| 119 | ++ * @return if any of the entries were a part of this team |
| 120 | ++ * @throws IllegalArgumentException if entries is null |
| 121 | ++ * @throws IllegalStateException if this team has been unregistered |
| 122 | ++ */ |
| 123 | ++ boolean removeEntries(@NotNull java.util.Collection<String> entries) throws IllegalStateException, IllegalArgumentException; |
| 124 | ++ // Paper end |
| 125 | ++ |
| 126 | + /** |
| 127 | + * Unregisters this team from the Scoreboard |
| 128 | + * |
0 commit comments