In function LightTexture#block(int) there's the following logic:
return (packed >> 4) & 0xFFFF;If the input values contain any non-zero bit in the low bits of the upper portion (eg 0x00EF_0000), the result of this expression will be 0xF000, instead of the expected value of (0x0000). This doesn't appear to be an active issue in the limited usage of this function in vanilla code, but is incorrect nonetheless.
Fix is to mask first, before shifting:
return (packed & 0xFFFF) >> 4;
EDIT: Updated the SRG name to official, which I forgot to do when I posted the ticket.
Comments 4
I took a peek at the code, and as of 26.2 the method (now in LightCoordsUtil) has different bit mask so the described issue is no longer there. This ticket can be closed.
This has been fixed as of 24w33a:
return (packed >>> 4) & 0xF;1.21.1 (and below):
return (packed >> 4) & 0xFFFF;
Can confirm in 1.18 Pre-release 1.