juancarloscp52 / BedrockIfy

A Minecraft mod that implements some Minecraft Bedrock features into Java edition.
GNU General Public License v3.0
178 stars 38 forks source link

[feat] Bedrock Sheep Colors #241

Closed lonefelidae16 closed 1 year ago

lonefelidae16 commented 1 year ago

Oooops I’m really sorry! I completely forgot about the code I wrote myself.

This branch was created as a feature for 1.19.3, but it also works on 1.19.4.


resolve #120

This enables the color of sheep wool to be displayed after shearing. It also supports a Disco sheep named “jeb_”.

A new configurable boolean sheepColors is available, and I haven’t added it to SettingsGUI. Please check BedrockifyClientSettings.java.

Also supports user modification by Resource pack. Thank you @Fuzss for your advice!

Fuzss commented 1 year ago

In case you're interested, this mod uses a better approach to implementing this feature which is compatible with a lot of resource packs. The idea is to dynamically generate sheep_sheared.png at runtime from the vanilla sheared sheep texture. The pixels that need to be colorized can be filtered out dynamically since they use the grayscale color space, while other parts of the texture like skin don't.

lonefelidae16 commented 1 year ago

I checked it, yes it is very interesting approach.

So, how can I make only the skin transparent from the vanilla texture? If I choose to extract the part with zero saturation, this time even the eye color will change.

Fuzss commented 1 year ago

Yeah, I found that issue as well. My approach would be to simply ignore the upper 1-2% of grayscale space. Also limiting this rule to the face region of the texture file would make sense and limit a possible error with resource packs significantly. Might be important to determine the face region using relative uv coordinates since textures might have a higher resolution than vanilla.

I also went through a few resource packs and this approach seems to work well in theory.

lonefelidae16 commented 1 year ago

Hm... I see. It may take a while, but I’ll try it.

I agree with you that it would be more user-friendly to be able to change it easily from the resource pack, as you mentioned. Thank you for sharing this.

lonefelidae16 commented 1 year ago

Confirmed with: