Replace fanciful with KyoriPowered/text
This commit is contained in:
+2
-2
@@ -46,8 +46,8 @@
|
||||
<createDependencyReducedPom>false</createDependencyReducedPom>
|
||||
<relocations>
|
||||
<relocation>
|
||||
<pattern>io.github.mkremins.fanciful</pattern>
|
||||
<shadedPattern>me.lucko.luckperms.lib.fanciful</shadedPattern>
|
||||
<pattern>net.kyori.text</pattern>
|
||||
<shadedPattern>me.lucko.luckperms.lib.text</shadedPattern>
|
||||
</relocation>
|
||||
</relocations>
|
||||
</configuration>
|
||||
|
||||
@@ -29,12 +29,13 @@ import me.lucko.luckperms.common.commands.sender.SenderFactory;
|
||||
import me.lucko.luckperms.common.constants.Constants;
|
||||
import me.lucko.luckperms.common.plugin.LuckPermsPlugin;
|
||||
|
||||
import net.kyori.text.Component;
|
||||
import net.kyori.text.serializer.ComponentSerializer;
|
||||
|
||||
import org.spongepowered.api.command.CommandSource;
|
||||
import org.spongepowered.api.entity.living.player.Player;
|
||||
import org.spongepowered.api.text.serializer.TextSerializers;
|
||||
|
||||
import io.github.mkremins.fanciful.FancyMessage;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
public class SpongeSenderFactory extends SenderFactory<CommandSource> {
|
||||
@@ -65,11 +66,11 @@ public class SpongeSenderFactory extends SenderFactory<CommandSource> {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void sendMessage(CommandSource source, FancyMessage message) {
|
||||
protected void sendMessage(CommandSource source, Component message) {
|
||||
try {
|
||||
source.sendMessage(TextSerializers.JSON.deserialize(message.exportToJson()));
|
||||
source.sendMessage(TextSerializers.JSON.deserialize(ComponentSerializer.serialize(message)));
|
||||
} catch (Exception e) {
|
||||
sendMessage(source, message.toOldMessageFormat());
|
||||
sendMessage(source, ComponentSerializer.toLegacy(message, Constants.COLOR_CHAR));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user