From 81b45d710bf1198e5afac371f790d0c3133f9364 Mon Sep 17 00:00:00 2001 From: powercas_gamer Date: Sat, 12 Aug 2023 19:49:08 +0200 Subject: [PATCH] feat: add TabList#addEntries (#987) --- .../api/proxy/player/TabList.java | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/api/src/main/java/com/velocitypowered/api/proxy/player/TabList.java b/api/src/main/java/com/velocitypowered/api/proxy/player/TabList.java index bceed260f..4d03d3a87 100644 --- a/api/src/main/java/com/velocitypowered/api/proxy/player/TabList.java +++ b/api/src/main/java/com/velocitypowered/api/proxy/player/TabList.java @@ -43,6 +43,28 @@ public interface TabList { */ void addEntry(TabListEntry entry); + /** + * Adds a {@link Iterable} of {@link TabListEntry}'s to the {@link Player}'s tab list. + * + * @param entries to add to the tab list + */ + default void addEntries(Iterable entries) { + for (TabListEntry entry : entries) { + addEntry(entry); + } + } + + /** + * Adds an array of {@link TabListEntry}'s to the {@link Player}'s tab list. + * + * @param entries to add to the tab list + */ + default void addEntries(TabListEntry... entries) { + for (TabListEntry entry : entries) { + addEntry(entry); + } + } + /** * Removes the {@link TabListEntry} from the tab list with the {@link GameProfile} identified with * the specified {@link UUID}.