fix: crash when joining world
Upstream renamed the method "com.mojang.blaze3d.platform.NativeImage$getPixelRGBA" to "getPixelABGR" and made it private. So add the AccessTransformer to make it public and follow upstream rename.
This commit is contained in:
parent
9dd8b8c0eb
commit
b727ae677d
@ -39,6 +39,10 @@ java {
|
||||
targetCompatibility = JavaVersion.valueOf("VERSION_${javaVersion}")
|
||||
}
|
||||
|
||||
loom {
|
||||
accessWidenerPath = file("src/main/resources/${modId}.accesswidener")
|
||||
}
|
||||
|
||||
modrinth {
|
||||
token = System.getenv("MODRINTH_TOKEN") ?: properties["modrinth_token"]?.toString()
|
||||
projectId = modId
|
||||
|
@ -28,9 +28,8 @@ public class Utils {
|
||||
var timesForSlim = new HashMap<Integer, Integer>();
|
||||
PlayerSkin.Model result = null;
|
||||
|
||||
// The result of NativeImage.getPixelRGBA() is ARGB, not RGBA, like 0xAARRGGBB
|
||||
PLAYER_SKIN_DIFF_SLIM_TO_WILD.forEach(p -> timesForDiff.merge(image.getPixelRGBA(p.x(), p.y()), 1, Integer::sum));
|
||||
PLAYER_SKIN_SLIM.forEach(p -> timesForSlim.merge(image.getPixelRGBA(p.x(), p.y()), 1, Integer::sum));
|
||||
PLAYER_SKIN_DIFF_SLIM_TO_WILD.forEach(p -> timesForDiff.merge(image.getPixelABGR(p.x(), p.y()), 1, Integer::sum));
|
||||
PLAYER_SKIN_SLIM.forEach(p -> timesForSlim.merge(image.getPixelABGR(p.x(), p.y()), 1, Integer::sum));
|
||||
|
||||
var blackTimesForDiff = timesForDiff.getOrDefault(0xff000000, 0);
|
||||
var blackTimesForSlim = timesForSlim.getOrDefault(0xff000000, 0);
|
||||
|
@ -33,4 +33,5 @@
|
||||
"suggests": {
|
||||
"another-mod": "*"
|
||||
}
|
||||
"accessWidener": "${mod_id}.accesswidener",
|
||||
}
|
2
src/main/resources/skintypefix.accesswidener
Normal file
2
src/main/resources/skintypefix.accesswidener
Normal file
@ -0,0 +1,2 @@
|
||||
accessWidener v2 named
|
||||
accessible method com/mojang/blaze3d/platform/NativeImage getPixelABGR (II)I
|
Loading…
Reference in New Issue
Block a user