-
Bug
-
Resolution: Fixed
-
Minor
-
None
-
None
-
MacOS
-
Magic
I have a plugin that setsĀ blocks in-game from map items (e.g. pixel art using wool blocks). It works using MapPalette.imageToBytes, and then passing each of those bytes to MapPalette.getColor(byte).
This worked prior to 1.12, but now in 1.12 I will sometimes get an IndexOutOfBoundsException.
I believe this is due to the commit that added more colors:
But the valid ranges for bytes was not updated to include the new colors:
I am not certain I know how to fix this correctly myself, so I would appreciate some feedback. If no one has a fix ready I will give it a shot when I get a chance.
It may also be that matchColor needs updating as well, though I am not sure.