mirror of
https://github.com/MineLittlePony/MineLittlePony.git
synced 2024-11-21 20:18:01 +01:00
Only use a player's skin if it's ponified skin. (Human skins don't fit villagers). Fixes #228
This commit is contained in:
parent
86b2cc16dc
commit
28852597a7
1 changed files with 1 additions and 12 deletions
|
@ -5,14 +5,11 @@ import net.minecraft.entity.LivingEntity;
|
|||
import net.minecraft.util.Identifier;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import com.minelittlepony.api.config.PonyConfig;
|
||||
import com.minelittlepony.api.config.PonyLevel;
|
||||
import com.minelittlepony.api.pony.IPony;
|
||||
import com.minelittlepony.client.SkinsProxy;
|
||||
import com.minelittlepony.util.FunctionUtil;
|
||||
import com.mojang.authlib.GameProfile;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.function.Function;
|
||||
|
||||
public class PlayerTextureSupplier {
|
||||
|
@ -28,13 +25,10 @@ public class PlayerTextureSupplier {
|
|||
}
|
||||
|
||||
static final class Entry {
|
||||
private final UUID uuid;
|
||||
|
||||
@Nullable
|
||||
private GameProfile profile;
|
||||
|
||||
Entry(LivingEntity entity) {
|
||||
uuid = entity.getUuid();
|
||||
SkullBlockEntity.loadProperties(new GameProfile(null, entity.getCustomName().getString()), resolved -> {
|
||||
profile = resolved;
|
||||
});
|
||||
|
@ -44,12 +38,7 @@ public class PlayerTextureSupplier {
|
|||
public Identifier getTexture() {
|
||||
if (profile != null) {
|
||||
Identifier skin = SkinsProxy.instance.getSkinTexture(profile);
|
||||
if (skin != null) {
|
||||
if (IPony.getManager().getPony(skin).race().isHuman()) {
|
||||
if (PonyConfig.getInstance().ponyLevel.get() == PonyLevel.PONIES) {
|
||||
return IPony.getManager().getBackgroundPony(uuid).texture();
|
||||
}
|
||||
}
|
||||
if (skin != null && !IPony.getManager().getPony(skin).race().isHuman()) {
|
||||
return skin;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue