use of net.minecraft.network.protocol.game.ClientboundBossEventPacket in project SpongeCommon by SpongePowered.
the class ServerPlayerMixin method bridge$setLanguage.
@Override
public void bridge$setLanguage(final Locale language) {
// Update locale on Channel, used for sending localized messages
if (this.connection != null) {
final Channel channel = ((ConnectionAccessor) this.connection.connection).accessor$channel();
channel.attr(SpongeAdventure.CHANNEL_LOCALE).set(language);
SpongeAdventure.forEachBossBar(bar -> {
if (bar.getPlayers().contains(this)) {
this.connection.send(new ClientboundBossEventPacket(ClientboundBossEventPacket.Operation.UPDATE_NAME, bar));
}
});
}
this.impl$language = language;
}
Aggregations