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
cd4f627e16
commit
8e58fc6691
@ -36,6 +36,7 @@ java {
|
||||
|
||||
neoForge {
|
||||
version = loaderVersion
|
||||
validateAccessTransformers = true
|
||||
|
||||
mods {
|
||||
register(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);
|
||||
|
1
src/main/resources/META-INF/accesstransformer.cfg
Normal file
1
src/main/resources/META-INF/accesstransformer.cfg
Normal file
@ -0,0 +1 @@
|
||||
public com.mojang.blaze3d.platform.NativeImage getPixelABGR(II)I
|
@ -12,6 +12,9 @@ logoFile="assets/${mod_id}/logo.png"
|
||||
authors="${mod_authors}"
|
||||
description='''${mod_description}'''
|
||||
|
||||
[[accessTransformers]]
|
||||
file="META-INF/accesstransformer.cfg"
|
||||
|
||||
[[mixins]]
|
||||
config="${mod_id}.mixins.json"
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user