9
0
mirror of https://github.com/BX-Team/DivineMC.git synced 2025-12-20 07:19:23 +00:00

move patches to work

This commit is contained in:
NONPLAYT
2025-07-06 01:21:32 +03:00
parent c15046f9ae
commit dd0274ddc1
86 changed files with 17 additions and 2172 deletions

View File

@@ -0,0 +1,29 @@
--- 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;
}