Jump to content

Dyeable entity not changing colors and only displaying as white (Solved)


Sunfished

Recommended Posts

Hello! I'm fairly new to modding so I apologize for how noobish I am, and I am on the cusp of finally moving past the rendering of my custom entity but am currently stuck at figuring out what I'm doing wrong.

For starters, my entity has dyeable properties, which should allow it to change colors. However, no matter what I do it doesn't seem to be coloring the entity correctly, which I believe may be due to me not including something that I can't figure out.

 

Without the dyeing code/properties, my entity looks like the image on the left, but enabling the layers, it ends up becoming pure white: 

327f3c460b.png081765e7f5.png

My entity has two layers that are being rendered, being the green and yellow sections. I know that these layers are being rendered since it contains a fuzzy filter that I've only applied on the two layers. The only problem is that these layers aren't being colored, and I've almost completely replicated the code found in the wolf classes. Checking the NBT data on the entity also shows that these two colors are existing, and using dyes on it is changing these values. Is there potentially something I'm missing? From what's going on, I'm assuming it's because I'm not somehow blending the color correctly, but the lack of documentation on this has given me no hints as to what I'm actually doing wrong.

 

The github can be found here: https://github.com/Sunfished/PoggMod

For quickness, here is a link to the important files regarding the entity:

Renderer

Layer 1(Green Colors) - Layer 2(Yellow Colors)

Model

Entity

 

Thank you for taking your time to look over this! I'm still learning so I would love at least a little poke in the right direction so I can do it myself!

 

Edit: Solution was found. Had to use one of the overloaded render methods that accepted the rgb values in the model class

 

Edited by Sunfished
solution found
Link to comment
Share on other sites

3 hours ago, Sunfished said:

Thank you for taking your time to look over this! I'm still learning so I would love at least a little poke in the right direction so I can do it myself!

 

You are using the overload for ModelRenderer.render() that doesn't take rgb parameters and always renders the texture white. Change the call to body.render() in the renderToBuffer() method in your PoggModel class to actually use the supplied red, green, blue, alpha parameters.

  • Thanks 1
Link to comment
Share on other sites

18 minutes ago, vemerion said:

You are using the overload for ModelRenderer.render() that doesn't take rgb parameters and always renders the texture white. Change the call to body.render() in the renderToBuffer() method in your PoggModel class to actually use the supplied red, green, blue, alpha parameters.

Bless! I knew there was something I forgot! Thanks a lot!

Link to comment
Share on other sites

  • Sunfished changed the title to Dyeable entity not changing colors and only displaying as white (Solved)

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.