diff --git a/Spigot-API-Patches/Player-Tab-List-and-Title-APIs.patch b/Spigot-API-Patches/Player-Tab-List-and-Title-APIs.patch index 5711dc0fe8..6fe5f79607 100644 --- a/Spigot-API-Patches/Player-Tab-List-and-Title-APIs.patch +++ b/Spigot-API-Patches/Player-Tab-List-and-Title-APIs.patch @@ -3,6 +3,7 @@ From: Techcable Date: Mon, 29 Feb 2016 20:02:40 -0600 Subject: [PATCH] Player Tab List and Title APIs +Co-authored-by: Fruxz diff --git a/src/main/java/com/destroystokyo/paper/Title.java b/src/main/java/com/destroystokyo/paper/Title.java new file mode 100644 @@ -15,10 +16,16 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 +import net.md_5.bungee.api.chat.BaseComponent; +import net.md_5.bungee.api.chat.TextComponent; + ++import org.bukkit.Bukkit; +import org.bukkit.entity.Player; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + ++import java.util.ArrayList; ++import java.util.Arrays; ++import java.util.Collection; ++import java.util.List; ++ +import static com.google.common.base.Preconditions.checkArgument; +import static com.google.common.base.Preconditions.checkNotNull; +import static com.google.common.base.Preconditions.checkState; @@ -236,6 +243,44 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + return this.fadeOut; + } + ++ /** ++ * Sends the title directly to an player ++ * ++ * @param player the receiver of the title ++ */ ++ public void send(@NotNull Player player) { ++ player.sendTitle(this); ++ } ++ ++ /** ++ * Sends the title directly to the defined players ++ * ++ * @param players the receivers of the title ++ */ ++ public void send(@NotNull Collection players) { ++ for (Player player : players) { ++ player.sendTitle(this); ++ } ++ } ++ ++ /** ++ * Sends the title directly to the defined players ++ * ++ * @param players the receivers of the title ++ */ ++ public void send(@NotNull Player[] players) { ++ for (Player player : players) { ++ player.sendTitle(this); ++ } ++ } ++ ++ /** ++ * Sends the title directly to all online players ++ */ ++ public void broadcast() { ++ send(Bukkit.getOnlinePlayers()); ++ } ++ + @NotNull + public static Builder builder() { + return new Builder(); @@ -388,7 +433,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/src/main/java/org/bukkit/entity/Player.java +++ b/src/main/java/org/bukkit/entity/Player.java @@ -0,0 +0,0 @@ package org.bukkit.entity; - + import java.net.InetSocketAddress; import java.util.UUID; +import com.destroystokyo.paper.Title; // Paper @@ -510,5 +555,5 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + */ + public void hideTitle(); // Paper end - + /**