aboutsummaryrefslogtreecommitdiff
path: root/spark-bungeecord
diff options
context:
space:
mode:
Diffstat (limited to 'spark-bungeecord')
-rw-r--r--spark-bungeecord/build.gradle1
-rw-r--r--spark-bungeecord/src/main/java/me/lucko/spark/bungeecord/SparkBungeeCordPlugin.java15
2 files changed, 5 insertions, 11 deletions
diff --git a/spark-bungeecord/build.gradle b/spark-bungeecord/build.gradle
index f94e651..55dcb4e 100644
--- a/spark-bungeecord/build.gradle
+++ b/spark-bungeecord/build.gradle
@@ -1,5 +1,6 @@
dependencies {
compile project(':spark-common')
+ compile 'net.kyori:text-adapter-bungeecord:1.0.3'
compileOnly 'net.md-5:bungeecord-api:1.12-SNAPSHOT'
}
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