Ridanisaurus / EmendatusEnigmatica

Minecraft Unification Mod
MIT License
38 stars 16 forks source link

Custom fluid colours are invisible by default in UIs #199

Closed Fuyukai closed 10 months ago

Fuyukai commented 1 year ago

Issue description

Custom fluids are completely invisible in UIs unless you specify an alpha; since Integer.parseInt is signed you can't prefix it with FF either.

You can sorta work around this with evil bit hacking (doing -1 * (~{COLOUR} & ((1 << 24) - 1)) sets the upper 8 bits to FF, thanks to two's compliment, so putting that in the JSON does work) but that's kinda silly imo.

Steps to reproduce

  1. Add a material
  2. Set its fluid colour (e.g. 0xABCDEF)
  3. Watch as the fluid itself is invisible in JEI, or in modded tank blocks

Minecraft version

1.19.2 (Latest)

Forge version

43.2.6

Emendatus Enigmatica version

2.1.x (Latest)

Other relevant versions

No response

If a (crash)log is relevant for this issue, link it here: (It's almost always relevant)

No response

Ridanisaurus commented 1 year ago

Could you please share the color: code block of your material here

Fuyukai commented 1 year ago

Sorry, I completely messed up when writing this and forgot to modify it; it's invisible in JEI and fluid tank mods (which use the alpha to e.g. render indicator markers on thee GUI texture, for example). I'll update the main issue body.

Example colour block, shows up blue fine for the fluid block itself:

    "colors": {
        "materialColor": "25344e",
        "fluidColor": "25344e"
    }

If I change tthe fluid colour to -00dacbb1 (the inverse of the colour) it works fine. Note that ChemLib had a similar issue with this exact probleem.

MechOrigin commented 1 year ago

I second this bug.