diff --git a/platform-facet/src/main/java/net/kyori/adventure/platform/facet/FacetAudience.java b/platform-facet/src/main/java/net/kyori/adventure/platform/facet/FacetAudience.java index dd63dac2..8166e3f1 100644 --- a/platform-facet/src/main/java/net/kyori/adventure/platform/facet/FacetAudience.java +++ b/platform-facet/src/main/java/net/kyori/adventure/platform/facet/FacetAudience.java @@ -47,6 +47,7 @@ import org.jetbrains.annotations.ApiStatus; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; +import org.jetbrains.annotations.UnmodifiableView; import static java.util.Objects.requireNonNull; @@ -406,6 +407,23 @@ public void hideBossBar(final @NotNull BossBar bar) { } } + /** + * Check if this audience has been shown this BossBar + * @since 4.1.3 + */ + public boolean hasBossBar(final @NotNull BossBar bar) { + return this.bossBars != null && this.bossBars.containsKey(bar); + } + + /** + * Returns a set containing all BossBars this Audience has been shown + * @since 4.1.3 + */ + public @NotNull @UnmodifiableView Set getBossBars() { + if (this.bossBars == null) return Collections.emptySet(); + return Collections.unmodifiableSet(this.bossBars.keySet()); + } + @Override public void sendPlayerListHeader(final @NotNull Component header) { if (this.tabList != null) {