-
-
Notifications
You must be signed in to change notification settings - Fork 144
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
Boss Bar API #337
Labels
Comments
rj00a
added
enhancement
New feature or request
good first issue
Good for newcomers
labels
May 23, 2023
@rj00a I am interested to work on this issue. But I need some help. |
Here some some references/pointers to get you started:
All you need to do is make the components and implement the systems to actually send the packets, preferably with unit tests. |
Merged
rj00a
pushed a commit
that referenced
this issue
Jun 20, 2023
## Description Hey, I started working on this issue #337. ### So far: - I created a crate "**valence_boss_bar**" and I moved this packet there https://github.com/valence-rs/valence/blob/2ed5a8840da244d8f1f91f1df43750664952be46/crates/valence_core/src/protocol/packet.rs#L612 - I initialized the plugin and added a system that removes the players when a boss bar is despawned. - I created/moved the boss bar components (BossBarTitle, BossBarHealth, BossBarStyle, BossBarFlags and BossBarViewers) - I added systems that handle the update of boss bar attributes and player disconnection - I documented the code - I made unit tests ### Playground I've tested the API in playground and it works fine. https://github.com/valence-rs/valence/assets/29759371/5661873b-c3a7-4a5d-b9e6-6c739bef4c2f --------- Co-authored-by: pepperoni21 <pepperoni2100@gmail.com>
This should be closed. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the problem related to your feature request.
There is no API for boss bars.
What solution would you like?
Create a new crate called
valence_boss_bar
. Every boss bar is an entity with the following components:BossBarTitle
BossBarHealth
BossBarStyle
(contains color and division)BossBarFlags
Uuid
(defined invalence_entity
currently)BossBarViewers
. Contains the set of client entities viewing this boss bar. When the boss bar is despawned with theDespawned
component, the boss bar is removed from all viewers.Change detection on the components is used to send packets to the boss bar viewers.
Also might be good to use another component containing a
Vec<u8>
to cache boss bar packets before sending them to viewers.What alternative(s) have you considered?
When entity relations in
bevy_ecs
become a thing, theBossBarViewers
component could probably be replaced with aboss bar -> client
relation for each viewer.Additional context
See the
BossBarS2c
packet.The text was updated successfully, but these errors were encountered: