Jump to content

Best way to create a new dye.


Eridani

Recommended Posts

Howdy! I have a simple objective, to make a new dye and fully incorporate it into the game give it its own wool, terractotta, banner, etc. Creating the dye item is easy - register dye item,  make json recipe, done. But, I want to create super classes of the dyeable items in the game and set them to this maroon tint. And I don't know how to approach this.

 

I see that many of these classes take the dyecolor as an argument, so allegedly if I simply add a color to the class I can then create many of the things I want with the new dyeColor. But since .class files are not modifiable (because they need to maintain where they come from), I cannot just add the dye . I also see the materialColor class, which I can create an new material color, but I don't know when that is used.

 

There is also a colorhandlerevent where one can set the color of a textures layer of an object - this is what I think is the needed section. As of writing this I haven't read deeply to see how sepcifically each uniuqe block is colored, but this might be the right things to use where I can get the color of each object and set it during its construction by calling the colorhandler event. At any rate, there are probably also exceptions as well (such as glazed terracotta.)

 

Just help understanding how objects are given color in general is probably all I need. Thank you in advance!

Link to comment
Share on other sites

You've demystified this a little bit for me and pointed out a good note - if I want to duplicate existing items, since I have the source code I can technically copy and paste it into my own class to clone the complete logic. I'll see how that goes. 

 

Thank you!

Edited by Eridani
Link to comment
Share on other sites

  • 5 months later...

For DyeColor, you can try using MaterialColor instead. DyeColor really is just a wrapper for it anyway.

Note: You must create your OWN MaterialColor Instance with NO constructor arguments (the default one has a hard limit for the number of colors) and manually set the "colorValue" field

It's pretty complicated

Edited by Majd123mc
Clarification
Link to comment
Share on other sites

Yup, I saw that as well. And I'm not sure of any way around it.

I guess you'll have to manually add the colors to each block using your own system.

1 minute ago, diesieben07 said:

MaterialColor is hardcoded to a max of 64 IDs which are also fixed, not synced and not managed in any kind of registry. Adding new ones with a mod is not feasible.

 

Link to comment
Share on other sites

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.