Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add methods for extended BossBar interaction #105

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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<BossBar> 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) {
Expand Down