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

Make bossbar use EntityLayer for visibility #437

Merged
merged 6 commits into from
Aug 10, 2023

Conversation

Bafbi
Copy link
Contributor

@Bafbi Bafbi commented Aug 3, 2023

Objective

We want things to be easy for the user as possible, so I used the same api principes from EntityLayer.

Solution

BossBarBundle also have an EntityLayerId that says in what layer they are, and client see bossbar that are in his VisibleEntityLayers.

crates/valence_boss_bar/src/components.rs Outdated Show resolved Hide resolved
crates/valence_boss_bar/src/components.rs Show resolved Hide resolved
crates/valence_packet/src/packets/play/boss_bar_s2c.rs Outdated Show resolved Hide resolved
crates/valence_boss_bar/src/lib.rs Outdated Show resolved Hide resolved
crates/valence_boss_bar/src/lib.rs Show resolved Hide resolved
crates/valence_boss_bar/src/lib.rs Outdated Show resolved Hide resolved
crates/valence_boss_bar/src/lib.rs Outdated Show resolved Hide resolved
Bafbi and others added 3 commits August 4, 2023 16:37
When a bossbar as a `Position` componant, the bossbar will only be shown when in view.
@Bafbi Bafbi requested a review from rj00a August 9, 2023 20:14
crates/valence_inventory/src/lib.rs Outdated Show resolved Hide resolved
examples/boss_bar.rs Outdated Show resolved Hide resolved
@dyc3 dyc3 merged commit 5135c18 into valence-rs:main Aug 10, 2023
13 checks passed
@Bafbi Bafbi deleted the layered_bossbar branch August 10, 2023 20:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants