mirror of
https://github.com/MineLittlePony/MineLittlePony.git
synced 2024-11-22 04:27:59 +01:00
Fixed preview skins on 1.19.2
This commit is contained in:
parent
37eadf49ab
commit
219193a53e
2 changed files with 18 additions and 8 deletions
|
@ -1,20 +1,29 @@
|
|||
package com.minelittlepony.api.pony;
|
||||
|
||||
import net.minecraft.client.util.DefaultSkinHelper;
|
||||
import net.minecraft.util.Identifier;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import com.minelittlepony.client.MineLittlePony;
|
||||
import com.minelittlepony.settings.PonyLevel;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
public final class DefaultPonySkinHelper {
|
||||
public static final Identifier STEVE = new Identifier("minelittlepony", "textures/entity/player/wide/steve_pony.png");
|
||||
|
||||
private static final Map<Identifier, Identifier> SKINS = new HashMap<>();
|
||||
@Deprecated
|
||||
public static final Identifier ALEX = new Identifier("minelittlepony", "textures/entity/player/slim/alex_pony.png");
|
||||
|
||||
public static Identifier getPonySkin(Identifier original) {
|
||||
return SKINS.computeIfAbsent(original, DefaultPonySkinHelper::computePonySkin);
|
||||
return original.getPath().contains("steve") ? STEVE : ALEX;
|
||||
}
|
||||
|
||||
private static Identifier computePonySkin(Identifier original) {
|
||||
return new Identifier("minelittlepony", original.getPath().replace(".png", "_pony.png"));
|
||||
}
|
||||
@Deprecated
|
||||
public static Identifier getPonySkin(UUID profileId, boolean slimArms) {
|
||||
if (MineLittlePony.getInstance().getConfig().ponyLevel.get() != PonyLevel.PONIES) {
|
||||
return DefaultSkinHelper.getTexture(profileId);
|
||||
}
|
||||
boolean alex = (profileId.hashCode() & 1) == 1;
|
||||
return new Identifier("minelittlepony", "textures/entity/player/" + (slimArms ? "slim" : "wide") + "/" + (alex ? "alex" : "steve") + "_pony.png");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -40,7 +40,8 @@ class PonyPreview extends PlayerPreview {
|
|||
return DefaultSkinGenerator.generateGreyScale(wearable.getDefaultTexture(), wearable.getDefaultTexture(), getExclusion());
|
||||
}
|
||||
|
||||
return super.getDefaultSkin(type, slim);
|
||||
Identifier skin = getBlankSkin(type, slim);
|
||||
return DefaultSkinGenerator.generateGreyScale(type == SkinType.SKIN ? DefaultPonySkinHelper.getPonySkin(profile.getId(), slim) : skin, skin, getExclusion());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Reference in a new issue