Jump to content

[Solved] [1.17.1] Is there any way to make a boss bar use a color that isn't BossBarColor enum?


uSkizzik

Recommended Posts

10 minutes ago, diesieben07 said:

Your offsets are probably wrong. Or your texture is not actually 265 pixels but 256 pixels in size (I would hope it is 256 pixels).

As I said earlier, I'm using vanilla textures as a placeholder atm.
I looked around the values carefully and here's how it's rendering the colors:
1. It renders in the empty boss bar background by getting the ordinal of the color from the enum, multiplying it by 5 and then multiplying it by 2 which in my case results in 40 aka the texture starts at the 40th pixel.
2. It renders in the filled texture by doing the exact same calculation but adding 5. After that it sets it's width to the progress multiplied by 183
My best guess is that the progress isn't updating or something.

Edit: Well, the progress really isn't updating but I doubt that's what's causing the issue.

Edited by uSkizzik
Link to comment
Share on other sites

5 minutes ago, diesieben07 said:

Then the texture is 256x256, not 265.

Well, that was the issue. Now, what I need is to get the progress going because so far the bar doesn't seem to be updating.
Edit: I just pushed the progress to my repo, here are the links:
Package containing boss events, Packet, RenderGameOverlay

Edited by uSkizzik
Link to comment
Share on other sites

Well, it's working...
I don't know how and why it didn't work previously but it's working.
Thank you so much @diesieben07 for putting up with my stupidity this whole time and helping me figure this out.

EDIT: Oh we ain't done yet! I will most likely need help on the moving down too!

Edited by uSkizzik
Link to comment
Share on other sites

16 minutes ago, diesieben07 said:
  1. If you want your boss bars to cooperate with the vanilla rendering, you have to put them into the vanilla events map, not make your own. You can then use RenderGameOverlayEvent.BossInfo to alter the rendering of this custom bar. This is what I told you from the very start.

Alright, I made a customColor field in my LerpingBossEvent and extended the original. Now how do I change the rendering?
I need to change the drawBar but for that I need the k and j values which are set / changed in the for loop.

Link to comment
Share on other sites

  • uSkizzik changed the title to [Solved] [1.17.1] Is there any way to make a boss bar use a color that isn't BossBarColor enum?

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.