Jump to content

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


Recommended Posts

Posted (edited)
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
Posted (edited)

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
Posted
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.

  • 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.