--- a/src/main/java/org/bukkit/map/MapPalette.java +++ b/src/main/java/org/bukkit/map/MapPalette.java @@ -35,7 +_,7 @@ } @NotNull - static final Color[] colors = { + public static final Color[] colors = { // DivineMC - Pufferfish SIMD - make public // Start generate - MapPalette#colors // @GeneratedFrom 1.21.7 new Color(0x00000000, true), @@ -395,9 +_,15 @@ temp.getRGB(0, 0, temp.getWidth(), temp.getHeight(), pixels, 0, temp.getWidth()); byte[] result = new byte[temp.getWidth() * temp.getHeight()]; - for (int i = 0; i < pixels.length; i++) { - result[i] = matchColor(new Color(pixels[i], true)); + // DivineMC start - Pufferfish SIMD + if (gg.pufferfish.pufferfish.simd.SIMDDetection.isEnabled) { + gg.pufferfish.pufferfish.simd.VectorMapPalette.matchColorVectorized(pixels, result); + } else { + for (int i = 0; i < pixels.length; i++) { + result[i] = matchColor(new Color(pixels[i], true)); + } } + // DivineMC end - Pufferfish SIMD return result; }