Fix ColorInit and CustomMap deprecation warnings

This commit is contained in:
2026-06-12 09:49:32 +02:00
parent 117dbd08ae
commit 2d59eb81c7
4 changed files with 37 additions and 2 deletions
@@ -254,7 +254,8 @@ public class CustomMap implements Listener {
int green = pixels[i2];
int i3 = (y * width + x) * numBands + 2;
int blue = pixels[i3];
Color nearest = MapPalette.getColor(ColorInit.getColorByte(red, green, blue));
int colorIndex = ColorInit.getColorByte(red, green, blue);
Color nearest = MapPalette.colors[colorIndex >= 0 ? colorIndex : colorIndex + 256];
pixels[(y * width + x) * numBands] = nearest.getRed();
pixels[i2] = nearest.getGreen();