Fix sending component messages on older CB/S releases (#1344)

This commit is contained in:
Luck 2018-12-23 16:52:00 +00:00
parent e5c4b710f6
commit 8eed3131f2
No known key found for this signature in database
GPG Key ID: EFA9B3EC5FD90F8B
5 changed files with 14 additions and 7 deletions

View File

@ -13,7 +13,7 @@ dependencies {
compile project(':common')
compileOnly 'org.spigotmc:spigot-api:1.13.2-R0.1-SNAPSHOT'
compileOnly'net.kyori:text-adapter-bukkit:1.0.0'
compileOnly'net.kyori:text-adapter-bukkit:1.0.1'
compileOnly 'me.lucko:commodore:1.0'
compileOnly('net.milkbowl.vault:VaultAPI:1.6') {
exclude(module: 'bukkit')

View File

@ -6,6 +6,7 @@ dependencies {
compile project(':common')
compileOnly 'net.md-5:bungeecord-api:1.12-SNAPSHOT'
compileOnly 'net.kyori:text-adapter-bungeecord:1.0.1'
compileOnly 'com.imaginarycode.minecraft:RedisBungee:0.4'
// migration plugins

View File

@ -33,10 +33,9 @@ import me.lucko.luckperms.common.sender.SenderFactory;
import me.lucko.luckperms.common.util.TextUtils;
import net.kyori.text.Component;
import net.kyori.text.serializer.ComponentSerializers;
import net.kyori.text.adapter.bungeecord.TextAdapter;
import net.md_5.bungee.api.CommandSender;
import net.md_5.bungee.api.connection.ProxiedPlayer;
import net.md_5.bungee.chat.ComponentSerializer;
import java.util.UUID;
@ -68,7 +67,7 @@ public class BungeeSenderFactory extends SenderFactory<CommandSender> {
@Override
protected void sendMessage(CommandSender sender, Component message) {
sender.sendMessage(ComponentSerializer.parse(ComponentSerializers.JSON.serialize(message)));
TextAdapter.sendComponent(sender, message);
}
@Override

View File

@ -94,7 +94,7 @@ public class LPBungeePlugin extends AbstractLuckPermsPlugin {
@Override
protected Set<Dependency> getGlobalDependencies() {
return EnumSet.of(Dependency.TEXT, Dependency.CAFFEINE, Dependency.OKIO, Dependency.OKHTTP, Dependency.EVENT);
return EnumSet.of(Dependency.TEXT, Dependency.TEXT_ADAPTER_BUNGEECORD, Dependency.CAFFEINE, Dependency.OKIO, Dependency.OKHTTP, Dependency.EVENT);
}
@Override

View File

@ -69,8 +69,15 @@ public enum Dependency {
TEXT_ADAPTER_BUKKIT(
"net{}kyori",
"text-adapter-bukkit",
"1.0.0",
"2Ph9vLzuofbE4iMaTMOTaR+v0M1Dxn503ia9rwfn7x8=",
"1.0.1",
"WZp7wCp2+EJC+Q/hxGLh/FJJCrn5Zdi2A1z2hX67jAM=",
Relocation.of("text", "net{}kyori{}text")
),
TEXT_ADAPTER_BUNGEECORD(
"net{}kyori",
"text-adapter-bungeecord",
"1.0.1",
"A5JCRyp8Y/TIuQEtdOslo28am36DQHsgeK6FLa8aJCU=",
Relocation.of("text", "net{}kyori{}text")
),
EVENT(