Open leobeg opened 1 week ago
@Snowiiii What is the correct way of storing such information like UUIDs of the bossbars and which players can see them?
@Snowiiii What is the correct way of storing such information like UUIDs of the bossbars and which players can see them?
Maybe using a HashMap ?. Something like HashMap<UUID, Bossbar>
Maybe using a HashMap ?. Something like
HashMap<UUID, Bossbar>
Well I figured it out how the vanilla server stores it. It's in the level.dat. Afaik it's not read rn. Maybe that implementation of the level.dat is worth it's own PR. My plan rn is to just store to bossbars in memory and not performing read/write to this file. And as soon we have the data from the level file we can easily extend it.
Maybe using a HashMap ?. Something like
HashMap<UUID, Bossbar>
Well I figured it out how the vanilla server stores it. It's in the level.dat. Afaik it's not read rn. Maybe that implementation of the level.dat is worth it's own PR. My plan rn is to just store to bossbars in memory and not performing read/write to this file. And as soon we have the data from the level file we can easily extend it.
Ah you mean how to permanently storing it. Don't worry we currently don't use level.dat
and you don't have to for now. I plan to support that later
@Snowiiii It should be ready for review. Not gonna lie I really underestimated how big the bossbar feature is. As I'm quite new to rust I'm happy to recieve feedback. The only difference rn to the vanilla bossbar is that the title is a plain string and not a TextComponent as the cmd protocol has not implemented JSON Raw Text yet.
Description
This PR adds the Bossbar. It implements the following:
It does this by sending the CBossEvent packet. This PR does not try to add the bossbar spawning when starting a fight with the enderdragon/wither
Testing
Start the server an join. Add a bossbar with
/bossbar add namespace:id Title
Add the bossbar to the player./bossbar set namespace:id players @a
You should now see the bossbar :D. You can now test every other feature of the bossbar.Checklist
Things need to be done before this Pull Request can be merged.
cargo fmt
cargo clippy
(Kinda... transfer command produces error?!)ToDo