aboutsummaryrefslogtreecommitdiff
path: root/spark-bungeecord/src
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-bungeecord/src
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-bungeecord/src')
-rw-r--r--spark-bungeecord/src/main/java/me/lucko/spark/bungeecord/SparkBungeeCordPlugin.java15
1 files changed, 4 insertions, 11 deletions
diff --git a/spark-bungeecord/src/main/java/me/lucko/spark/bungeecord/SparkBungeeCordPlugin.java b/spark-bungeecord/src/main/java/me/lucko/spark/bungeecord/SparkBungeeCordPlugin.java
index 0bc118a..ba2ee99 100644
--- a/spark-bungeecord/src/main/java/me/lucko/spark/bungeecord/SparkBungeeCordPlugin.java
+++ b/spark-bungeecord/src/main/java/me/lucko/spark/bungeecord/SparkBungeeCordPlugin.java
@@ -24,9 +24,10 @@ 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.adapter.bungeecord.TextAdapter;
import net.md_5.bungee.api.ChatColor;
import net.md_5.bungee.api.CommandSender;
-import net.md_5.bungee.api.chat.ClickEvent;
import net.md_5.bungee.api.chat.TextComponent;
import net.md_5.bungee.api.plugin.Command;
import net.md_5.bungee.api.plugin.Plugin;
@@ -76,16 +77,8 @@ public class SparkBungeeCordPlugin extends Plugin implements SparkPlugin<Command
}
@Override
- public void sendMessage(CommandSender sender, String message) {
- sender.sendMessage(TextComponent.fromLegacyText(ChatColor.translateAlternateColorCodes('&', message)));
- }
-
- @Override
- public void sendLink(CommandSender sender, String url) {
- TextComponent component = new TextComponent(url);
- component.setColor(ChatColor.GRAY);
- component.setClickEvent(new ClickEvent(ClickEvent.Action.OPEN_URL, url));
- sender.sendMessage(component);
+ public void sendMessage(CommandSender sender, Component message) {
+ TextAdapter.sendComponent(sender, message);
}
@Override