Fixed legacy wearable skins using the body texture when they shouldn't be (Sorry, AJ, taixdermy is out of fashion)

This commit is contained in:
Sollace 2023-01-27 11:46:23 +00:00
parent 7fe4aa0d36
commit 60ece0cb46

View file

@ -1,6 +1,8 @@
package com.minelittlepony.client.hdskins;
import com.minelittlepony.api.pony.IPony;
import com.minelittlepony.api.pony.IPonyData;
import com.minelittlepony.api.pony.meta.Race;
import com.minelittlepony.api.pony.meta.Wearable;
import com.minelittlepony.client.MineLittlePony;
import com.minelittlepony.client.SkinsProxy;
@ -101,8 +103,14 @@ public class MineLPHDSkins extends SkinsProxy implements ClientModInitializer {
PlayerSkin main = dummy.getTextures().get(SkinType.SKIN);
Wearable wearable = Wearable.REGISTRY.getOrDefault(type.getId(), Wearable.NONE);
if (wearable != Wearable.NONE && IPony.getManager().getPony(main.getId()).metadata().isWearing(wearable)) {
return Optional.of(main.getId());
IPonyData metadata = IPony.getManager().getPony(main.getId()).metadata();
if (wearable != Wearable.NONE && metadata.isWearing(wearable)) {
if (wearable.isSaddlebags() && metadata.getRace() != Race.BATPONY) {
return Optional.of(main.getId());
}
return Optional.of(wearable.getDefaultTexture());
}
}