Skip to content

Commit

Permalink
Merge pull request #1067 from KyoriPowered/fix/1056
Browse files Browse the repository at this point in the history
fix(api): Only trigger bossbar listeners if flags actually changed
  • Loading branch information
zml2008 committed Apr 24, 2024
2 parents 3f61d40 + a884103 commit 600e710
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ static void checkProgress(final float progress) {

@Override
public @NotNull BossBar flags(final @NotNull Set<Flag> newFlags) {
if (newFlags.isEmpty()) {
if (newFlags.isEmpty() && !this.flags.isEmpty()) {
final Set<Flag> oldFlags = EnumSet.copyOf(this.flags);
this.flags.clear();
this.forEachListener(listener -> listener.bossBarFlagsChanged(this, Collections.emptySet(), oldFlags));
Expand Down

0 comments on commit 600e710

Please sign in to comment.