From 51fa2b3e64f021c3c0535f9f931d3fae27ca7adc Mon Sep 17 00:00:00 2001 From: Luck Date: Sat, 27 Apr 2019 18:34:58 +0100 Subject: Use text components instead of legacy formatting codes throughout the project --- .../java/me/lucko/spark/velocity/SparkVelocityPlugin.java | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) (limited to 'spark-velocity/src/main') diff --git a/spark-velocity/src/main/java/me/lucko/spark/velocity/SparkVelocityPlugin.java b/spark-velocity/src/main/java/me/lucko/spark/velocity/SparkVelocityPlugin.java index 749319d..c1c2f2d 100644 --- a/spark-velocity/src/main/java/me/lucko/spark/velocity/SparkVelocityPlugin.java +++ b/spark-velocity/src/main/java/me/lucko/spark/velocity/SparkVelocityPlugin.java @@ -34,6 +34,7 @@ import me.lucko.spark.common.SparkPlatform; import me.lucko.spark.common.SparkPlugin; import me.lucko.spark.common.sampler.ThreadDumper; import me.lucko.spark.common.sampler.TickCounter; +import net.kyori.text.Component; import net.kyori.text.TextComponent; import net.kyori.text.event.ClickEvent; import net.kyori.text.format.TextColor; @@ -110,19 +111,9 @@ public class SparkVelocityPlugin implements SparkPlugin, Command return senders; } - @SuppressWarnings("deprecation") @Override - public void sendMessage(CommandSource sender, String message) { - sender.sendMessage(ComponentSerializers.LEGACY.deserialize(message, '&')); - } - - @Override - public void sendLink(CommandSource sender, String url) { - TextComponent msg = TextComponent.builder(url) - .color(TextColor.GRAY) - .clickEvent(new ClickEvent(ClickEvent.Action.OPEN_URL, url)) - .build(); - sender.sendMessage(msg); + public void sendMessage(CommandSource sender, Component message) { + sender.sendMessage(message); } @Override -- cgit