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
58206c52cd
commit
1564c20876
1 changed files with 16 additions and 7 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");
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue