aboutsummaryrefslogtreecommitdiff
path: root/spark-sponge/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-sponge/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-sponge/src')
-rw-r--r--spark-sponge/src/main/java/me/lucko/spark/sponge/SparkSpongePlugin.java19
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