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:
29
patches/work/api/MapPalette.java.patch
Normal file
29
patches/work/api/MapPalette.java.patch
Normal 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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user