Skip to content

Commit

Permalink
Switch to BaseComponent in BossBar#setTitle for API compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
bivashy committed Feb 17, 2024
1 parent f933d13 commit 53bf72f
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@
import net.md_5.bungee.api.CommandSender;
import net.md_5.bungee.api.ProxyServer;
import net.md_5.bungee.api.chat.BaseComponent;
import net.md_5.bungee.api.chat.TextComponent;
import net.md_5.bungee.api.connection.Connection;
import net.md_5.bungee.api.connection.ProxiedPlayer;
import net.md_5.bungee.chat.ComponentSerializer;
import net.md_5.bungee.chat.TranslationRegistry;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
Expand Down Expand Up @@ -255,7 +255,7 @@ public void bossBarInitialized(final net.kyori.adventure.bossbar.@NotNull BossBa
@Override
public void bossBarNameChanged(final net.kyori.adventure.bossbar.@NotNull BossBar bar, final @NotNull Component oldName, final @NotNull Component newName) {
if (!this.viewers.isEmpty()) {
this.bar.setTitle(ComponentSerializer.toString(this.createMessage(this.viewers.iterator().next(), newName)));
this.bar.setTitle(TextComponent.fromArray(this.createMessage(this.viewers.iterator().next(), newName)));
this.broadcastPacket(ACTION_TITLE);
}
}
Expand Down

0 comments on commit 53bf72f

Please sign in to comment.