aboutsummaryrefslogtreecommitdiff
path: root/spark-velocity/src/main/java/me
diff options
context:
space:
mode:
authorLuck <git@lucko.me>2019-04-27 18:34:58 +0100
committerLuck <git@lucko.me>2019-04-27 18:34:58 +0100
commit51fa2b3e64f021c3c0535f9f931d3fae27ca7adc (patch)
tree8c17193be30335db15cbdfe7cc45fe80c4f4907d /spark-velocity/src/main/java/me
parent3cf9c7e31d2244db8155082512b439885cef8c3b (diff)
downloadspark-51fa2b3e64f021c3c0535f9f931d3fae27ca7adc.tar.gz
spark-51fa2b3e64f021c3c0535f9f931d3fae27ca7adc.tar.bz2
spark-51fa2b3e64f021c3c0535f9f931d3fae27ca7adc.zip
Use text components instead of legacy formatting codes throughout the project
Diffstat (limited to 'spark-velocity/src/main/java/me')
-rw-r--r--spark-velocity/src/main/java/me/lucko/spark/velocity/SparkVelocityPlugin.java15
1 files changed, 3 insertions, 12 deletions
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<CommandSource>, 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