Skip to content

BossBar Changes #1426

@TurboJax

Description

@TurboJax

I've been looking a lot at the BossBar api and wanted to propose a few changes.
I'm not one to figure out when things should be deprecated/removed, but I can throw out deprecation in v5, removal in v6 as a plan.

  1. Converting BossBar to a class and removing BossBarImpl.
    • BossBar is currently a sealed interface with BossBarImpl being its only permitted implementation.
    • I don't think that there are any plans to make another implementation of BossBar (correct me if I'm wrong).
    • This won't break any of the main implementations of adventure. The Paper, Velocity, Sponge, Fabric, and NeoForge implementations not only still use the adventure 4 api, but they all use BossBar instead of BossBarImpl.
    • It can also reduce confusion between BossBarImpl and BossBarImplementation, as they have similar names.
  2. Remove HackyBossBarPlatformBridge.
    • Only the Sponge API uses this class, and it's used to make BossBarImpl inherit their BossBarBridge class.
    • The mixin can easily target BossBarImpl (or BossBar if it becomes a class) instead of HackyBossBarPlatformBridge. (Correct me if I'm wrong)
    • This may cause api issues, so the class should probably be deprecated instead of outright removed.
  3. Make BossBar#viewers and BossBarViewer#activeBossBars return Sets instead of Iterables.
    • This may just be the beginner in me, but I feel like Sets are easier to handle than Iterables.
    • In this case BossBar#viewers would go from returning Iterable<? extends BossBarViewer> to Set<BossBarViewer>, and BossBarViewer#activeBossBars would go from Iterable<? extends BossBar> to Set<BossBar>
    • This is just me bringing up something I mentioned in feature(api): Remove BossBarViewer #1370 but adapted for if that pr doesn't go through.

Thoughts?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions