From 88b25a8c2b98d2a3dc45b28c1c492d890bef51dc Mon Sep 17 00:00:00 2001 From: Yannick Lamprecht Date: Sat, 22 Jun 2019 15:42:22 +0200 Subject: [PATCH] SPIGOT-5098: Add a method to allow colored sign changes --- src/main/java/org/bukkit/entity/Player.java | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java index 8f137539..ea112e45 100644 --- a/src/main/java/org/bukkit/entity/Player.java +++ b/src/main/java/org/bukkit/entity/Player.java @@ -2,6 +2,7 @@ package org.bukkit.entity; import java.net.InetSocketAddress; import org.bukkit.Achievement; +import org.bukkit.DyeColor; import org.bukkit.Effect; import org.bukkit.GameMode; import org.bukkit.Instrument; @@ -414,6 +415,26 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM */ public void sendSignChange(@NotNull Location loc, @Nullable String[] lines) throws IllegalArgumentException; + + /** + * Send a sign change. This fakes a sign change packet for a user at + * a certain location. This will not actually change the world in any way. + * This method will use a sign at the location's block or a faked sign + * sent via + * {@link #sendBlockChange(org.bukkit.Location, org.bukkit.Material, byte)}. + *

+ * If the client does not have a sign at the given location it will + * display an error message to the user. + * + * @param loc the location of the sign + * @param lines the new text on the sign or null to clear it + * @param dyeColor the color of the sign + * @throws IllegalArgumentException if location is null + * @throws IllegalArgumentException if dyeColor is null + * @throws IllegalArgumentException if lines is non-null and has a length less than 4 + */ + public void sendSignChange(@NotNull Location loc, @Nullable String[] lines, @NotNull DyeColor dyeColor) throws IllegalArgumentException; + /** * Render a map and send it to the player in its entirety. This may be * used when streaming the map in the normal manner is not desirable.