9
0
mirror of https://github.com/BX-Team/DivineMC.git synced 2025-12-19 14:59:25 +00:00
Files
DivineMC/patches/work/api/MapPalette.java.patch
2025-07-06 01:21:32 +03:00

30 lines
1.1 KiB
Diff

--- 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;
}