You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
BossBar implementations calls BossBar.Listener.bossBarFlagsChanged(...) if BossBar.flags(...) accepted an empty set, even if the flags were already empty. The following program:
// Create an example HelloWorld-alike problem.// Can be done without any underlying platform.BossBarbar = BossBar.bossBar(Component.text("test"), 0.0F, BossBar.Color.WHITE, BossBar.Overlay.PROGRESS, Set.of());
bar.addListener(newBossBar.Listener() {
@OverridepublicvoidbossBarFlagsChanged(@NotNullBossBarbar, @NotNullSet<BossBar.Flag> flagsAdded, @NotNullSet<BossBar.Flag> flagsRemoved) {
System.out.println("Changed from " + flagsAdded + " to " + flagsRemoved);
}
});
// Works as intended. (prints only once)bar.flags(Set.of(BossBar.Flag.CREATE_WORLD_FOG));
bar.flags(Set.of(BossBar.Flag.CREATE_WORLD_FOG));
bar.flags(Set.of(BossBar.Flag.CREATE_WORLD_FOG));
bar.flags(Set.of(BossBar.Flag.CREATE_WORLD_FOG));
bar.flags(Set.of(BossBar.Flag.CREATE_WORLD_FOG));
// Possibly broken behavior. (prints 5 times)bar.flags(Set.of());
bar.flags(Set.of());
bar.flags(Set.of());
bar.flags(Set.of());
bar.flags(Set.of());
prints this:
Changed from [CREATE_WORLD_FOG] to []
Changed from [] to [CREATE_WORLD_FOG]
Changed from [] to []
Changed from [] to []
Changed from [] to []
Changed from [] to []
Adventure versions: Both 4.16.0 and 4.17.0-SNAPSHOT.
The text was updated successfully, but these errors were encountered:
BossBar implementations calls
BossBar.Listener.bossBarFlagsChanged(...)
ifBossBar.flags(...)
accepted an empty set, even if the flags were already empty. The following program:prints this:
Adventure versions: Both 4.16.0 and 4.17.0-SNAPSHOT.
The text was updated successfully, but these errors were encountered: