diff options
author | Luck <git@lucko.me> | 2020-11-07 17:41:39 +0000 |
---|---|---|
committer | Luck <git@lucko.me> | 2020-11-07 17:41:39 +0000 |
commit | 8cc92ff83634dffacfe1f25a135bc9ac665ff68b (patch) | |
tree | 35efc9d9131c7ceb1db3822fbb6a0707535f7c18 /spark-sponge/src/main/java/me/lucko/spark/sponge/SpongeCommandSender.java | |
parent | 70a468e114316a98f6d7f7e91afa8d50639762c9 (diff) | |
download | spark-8cc92ff83634dffacfe1f25a135bc9ac665ff68b.tar.gz spark-8cc92ff83634dffacfe1f25a135bc9ac665ff68b.tar.bz2 spark-8cc92ff83634dffacfe1f25a135bc9ac665ff68b.zip |
Update from text to adventure
Diffstat (limited to 'spark-sponge/src/main/java/me/lucko/spark/sponge/SpongeCommandSender.java')
-rw-r--r-- | spark-sponge/src/main/java/me/lucko/spark/sponge/SpongeCommandSender.java | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/spark-sponge/src/main/java/me/lucko/spark/sponge/SpongeCommandSender.java b/spark-sponge/src/main/java/me/lucko/spark/sponge/SpongeCommandSender.java index ba0e5df..03766d2 100644 --- a/spark-sponge/src/main/java/me/lucko/spark/sponge/SpongeCommandSender.java +++ b/spark-sponge/src/main/java/me/lucko/spark/sponge/SpongeCommandSender.java @@ -21,16 +21,20 @@ package me.lucko.spark.sponge; import me.lucko.spark.common.command.sender.AbstractCommandSender; -import net.kyori.text.Component; -import net.kyori.text.adapter.spongeapi.TextAdapter; +import net.kyori.adventure.audience.Audience; +import net.kyori.adventure.platform.spongeapi.SpongeAudiences; +import net.kyori.adventure.text.Component; import org.spongepowered.api.command.CommandSource; import org.spongepowered.api.entity.living.player.Player; import java.util.UUID; public class SpongeCommandSender extends AbstractCommandSender<CommandSource> { - public SpongeCommandSender(CommandSource source) { + private final Audience audience; + + public SpongeCommandSender(CommandSource source, SpongeAudiences audienceFactory) { super(source); + this.audience = audienceFactory.receiver(source); } @Override @@ -48,7 +52,7 @@ public class SpongeCommandSender extends AbstractCommandSender<CommandSource> { @Override public void sendMessage(Component message) { - TextAdapter.sendMessage(super.delegate, message); + this.audience.sendMessage(message); } @Override |