maruohon / malilib

Library mod for masa's client-side Minecraft mods
GNU Lesser General Public License v3.0
294 stars 124 forks source link

[BUG] Color4f from integer gives incorrect green value #71

Open DarkKronicle opened 2 years ago

DarkKronicle commented 2 years ago

Green value when unpacking a color int is always when doing it though Color4f. The bitshift operator uses 0x000FF000 when it should instead be 0x0000FF00.

https://github.com/maruohon/malilib/blob/fabric_1.18.x/src/main/java/fi/dy/masa/malilib/util/Color4f.java#L62

maruohon commented 2 years ago

Same as #30. I'm somewhat surprised that I still didn't apparently fix it for any of the 1.13+ versions. It's fixed in the LiteLoader branch though, which will eventually replace/be "merged to" all the other branches, so the fix will at least come via that.

I guess I didn't think this to be a critical fix needing a new version pushed out, since you can use your own util method for this for now... The upcoming malilib rewrite will need vast changes in all dependent mods anyway, so getting rid of the temporary custom util method is a minor inconvenience during that update.