mirror of
https://github.com/MineLittlePony/MineLittlePony.git
synced 2025-03-21 11:17:12 +01:00
Update hdskins
This commit is contained in:
parent
f11530aa40
commit
ff45ce3d41
2 changed files with 11 additions and 6 deletions
|
@ -21,5 +21,5 @@ org.gradle.daemon=false
|
||||||
# Dependencies
|
# Dependencies
|
||||||
modmenu_version=9.0.0-pre.1
|
modmenu_version=9.0.0-pre.1
|
||||||
kirin_version=1.17.1+1.20.4
|
kirin_version=1.17.1+1.20.4
|
||||||
hd_skins_version=6.12.2+1.20.4
|
hd_skins_version=6.12.4+1.20.4
|
||||||
mson_version=1.9.3+1.20.2
|
mson_version=1.9.3+1.20.2
|
||||||
|
|
|
@ -11,6 +11,7 @@ import com.minelittlepony.hdskins.client.*;
|
||||||
import com.minelittlepony.hdskins.client.gui.GuiSkins;
|
import com.minelittlepony.hdskins.client.gui.GuiSkins;
|
||||||
import com.minelittlepony.hdskins.client.gui.player.DummyPlayer;
|
import com.minelittlepony.hdskins.client.gui.player.DummyPlayer;
|
||||||
import com.minelittlepony.hdskins.client.gui.player.skins.PlayerSkins.PlayerSkin;
|
import com.minelittlepony.hdskins.client.gui.player.skins.PlayerSkins.PlayerSkin;
|
||||||
|
import com.minelittlepony.hdskins.client.profile.SkinLoader.ProvidedSkins;
|
||||||
import com.minelittlepony.hdskins.profile.SkinType;
|
import com.minelittlepony.hdskins.profile.SkinType;
|
||||||
|
|
||||||
import com.mojang.authlib.GameProfile;
|
import com.mojang.authlib.GameProfile;
|
||||||
|
@ -75,7 +76,7 @@ public class MineLPHDSkins extends SkinsProxy implements ClientModInitializer {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
static Optional<Pony> getPony(PlayerSkins.Layer layer) {
|
static Optional<Pony> getPony(PlayerSkinLayers.Layer layer) {
|
||||||
return layer
|
return layer
|
||||||
.getSkin(SkinType.SKIN)
|
.getSkin(SkinType.SKIN)
|
||||||
.map(Pony.getManager()::getPony);
|
.map(Pony.getManager()::getPony);
|
||||||
|
@ -103,8 +104,9 @@ public class MineLPHDSkins extends SkinsProxy implements ClientModInitializer {
|
||||||
|
|
||||||
if (entity instanceof AbstractClientPlayerEntity player) {
|
if (entity instanceof AbstractClientPlayerEntity player) {
|
||||||
return PlayerSkins.of(player)
|
return PlayerSkins.of(player)
|
||||||
.map(PlayerSkins::combined)
|
.map(PlayerSkins::layers)
|
||||||
.map(PlayerSkins.Layer::getProvidedSkinTypes)
|
.map(PlayerSkinLayers::combined)
|
||||||
|
.map(PlayerSkinLayers.Layer::getProvidedSkinTypes)
|
||||||
.orElseGet(Set::of);
|
.orElseGet(Set::of);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -132,13 +134,16 @@ public class MineLPHDSkins extends SkinsProxy implements ClientModInitializer {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return Optional.of(player).flatMap(PlayerSkins::of).map(PlayerSkins::combined).flatMap(skins -> skins.getSkin(type));
|
return Optional.of(player).flatMap(PlayerSkins::of)
|
||||||
|
.map(PlayerSkins::layers)
|
||||||
|
.map(PlayerSkinLayers::combined).flatMap(skins -> skins.getSkin(type));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Identifier getSkinTexture(GameProfile profile) {
|
public Identifier getSkinTexture(GameProfile profile) {
|
||||||
return HDSkins.getInstance().getProfileRepository()
|
return HDSkins.getInstance().getProfileRepository()
|
||||||
.getNow(profile)
|
.load(profile)
|
||||||
|
.getNow(ProvidedSkins.EMPTY)
|
||||||
.getSkin(SkinType.SKIN)
|
.getSkin(SkinType.SKIN)
|
||||||
.orElseGet(() -> super.getSkinTexture(profile));
|
.orElseGet(() -> super.getSkinTexture(profile));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue