From 7feefdf40bc4bcaad6918376bd8940eb6e2bc5ed Mon Sep 17 00:00:00 2001 From: Riley Park Date: Tue, 8 Mar 2016 13:16:54 -0800 Subject: [PATCH] Add BaseComponent sendMessage methods to CommandSender --- ...t-sendMessage-methods-to-CommandSend.patch | 62 +++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 Spigot-API-Patches/Add-BaseComponent-sendMessage-methods-to-CommandSend.patch diff --git a/Spigot-API-Patches/Add-BaseComponent-sendMessage-methods-to-CommandSend.patch b/Spigot-API-Patches/Add-BaseComponent-sendMessage-methods-to-CommandSend.patch new file mode 100644 index 0000000000..dd236d26c6 --- /dev/null +++ b/Spigot-API-Patches/Add-BaseComponent-sendMessage-methods-to-CommandSend.patch @@ -0,0 +1,62 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Riley Park +Date: Tue, 8 Mar 2016 13:05:59 -0800 +Subject: [PATCH] Add BaseComponent sendMessage methods to CommandSender + + +diff --git a/src/main/java/org/bukkit/command/CommandSender.java b/src/main/java/org/bukkit/command/CommandSender.java +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/main/java/org/bukkit/command/CommandSender.java ++++ b/src/main/java/org/bukkit/command/CommandSender.java +@@ -0,0 +0,0 @@ public interface CommandSender extends Permissible { + * @return Name of the sender + */ + public String getName(); ++ ++ // Paper start ++ /** ++ * Sends the component to the sender ++ * ++ *

If this sender does not support sending full components then ++ * the component will be sent as legacy text.

++ * ++ * @param component the component to send ++ */ ++ default void sendMessage(net.md_5.bungee.api.chat.BaseComponent component) { ++ this.sendMessage(component.toLegacyText()); ++ } ++ ++ /** ++ * Sends an array of components as a single message to the sender ++ * ++ *

If this sender does not support sending full components then ++ * the components will be sent as legacy text.

++ * ++ * @param components the components to send ++ */ ++ default void sendMessage(net.md_5.bungee.api.chat.BaseComponent... components) { ++ this.sendMessage(new net.md_5.bungee.api.chat.TextComponent(components).toLegacyText()); ++ } ++ // Paper end + } +diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/main/java/org/bukkit/entity/Player.java ++++ b/src/main/java/org/bukkit/entity/Player.java +@@ -0,0 +0,0 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline + * + * @param component the components to send + */ ++ @Override + public void sendMessage(net.md_5.bungee.api.chat.BaseComponent component); + + /** +@@ -0,0 +0,0 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline + * + * @param components the components to send + */ ++ @Override + public void sendMessage(net.md_5.bungee.api.chat.BaseComponent... components); + + /** +-- \ No newline at end of file