diff options
Diffstat (limited to 'spark-sponge/src/main/java/me/lucko/spark/sponge')
-rw-r--r-- | spark-sponge/src/main/java/me/lucko/spark/sponge/SparkSpongePlugin.java | 19 |
1 files changed, 4 insertions, 15 deletions
diff --git a/spark-sponge/src/main/java/me/lucko/spark/sponge/SparkSpongePlugin.java b/spark-sponge/src/main/java/me/lucko/spark/sponge/SparkSpongePlugin.java index 159cbc7..c0727ac 100644 --- a/spark-sponge/src/main/java/me/lucko/spark/sponge/SparkSpongePlugin.java +++ b/spark-sponge/src/main/java/me/lucko/spark/sponge/SparkSpongePlugin.java @@ -25,6 +25,8 @@ 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.spongeapi.TextAdapter; import org.spongepowered.api.Game; import org.spongepowered.api.command.CommandCallable; import org.spongepowered.api.command.CommandResult; @@ -115,21 +117,8 @@ public class SparkSpongePlugin implements SparkPlugin<CommandSource> { } @Override - public void sendMessage(CommandSource sender, String message) { - sender.sendMessage(TextSerializers.FORMATTING_CODE.deserialize(message)); - } - - @Override - public void sendLink(CommandSource sender, String url) { - try { - Text msg = Text.builder(url) - .color(TextColors.GRAY) - .onClick(TextActions.openUrl(new URL(url))) - .build(); - sender.sendMessage(msg); - } catch (MalformedURLException e) { - e.printStackTrace(); - } + public void sendMessage(CommandSource sender, Component message) { + TextAdapter.sendComponent(sender, message); } @Override |