<commit_before>package com.minelittlepony.client.gui.hdskins;

import net.minecraft.util.Identifier;

import com.minelittlepony.MineLittlePony;
import com.minelittlepony.client.pony.Pony;
import com.minelittlepony.hdskins.dummy.DummyPlayer;
import com.minelittlepony.hdskins.dummy.PlayerPreview;
import com.minelittlepony.pony.IPony;
import com.minelittlepony.pony.meta.Race;
import com.mojang.authlib.minecraft.MinecraftProfileTexture.Type;

public class PonyPreview extends PlayerPreview {

    public static final Identifier NO_SKIN_PONY = new Identifier("minelittlepony", "textures/mob/noskin.png");
    public static final Identifier NO_SKIN_SEAPONY = new Identifier("minelittlepony", "textures/mob/noskin_seapony.png");

    private final DummyPony localPlayer = new DummyPony(localTextures);
    private final DummyPony remotePlayer = new DummyPony(remoteTextures);

    public void setWet(boolean isWet) {
        localPlayer.setWet(isWet);
        remotePlayer.setWet(isWet);
    }

    @Override
    public Identifier getBlankSkin(Type type) {
        if (type == Type.SKIN) {
            return localPlayer.wet ? NO_SKIN_SEAPONY : NO_SKIN_PONY;
        }
        return super.getBlankSkin(type);
    }

    protected DummyPlayer ponify(DummyPlayer human, DummyPlayer pony) {
        Identifier loc = human.getTextures().get(Type.SKIN).getId();

        if (loc == null || Pony.getBufferedImage(loc) == null) {
            return pony;
        }

        IPony thePony = MineLittlePony.getInstance().getManager().getPony(loc);

        Race race = thePony.getRace(false);

        if (race.isHuman()) {
            return human;
        }

        return pony;
    }

    @Override
    public DummyPlayer getRemote() {
        return ponify(super.getRemote(), remotePlayer);
    }


    @Override
    public DummyPlayer getLocal() {
        return ponify(super.getLocal(), localPlayer);
    }
}<commit_msg>Fixed NPC NPE<commit_after>package com.minelittlepony.client.gui.hdskins;

import net.minecraft.util.Identifier;

import com.minelittlepony.MineLittlePony;
import com.minelittlepony.client.pony.Pony;
import com.minelittlepony.hdskins.dummy.DummyPlayer;
import com.minelittlepony.hdskins.dummy.PlayerPreview;
import com.minelittlepony.pony.IPony;
import com.minelittlepony.pony.meta.Race;
import com.mojang.authlib.minecraft.MinecraftProfileTexture.Type;

public class PonyPreview extends PlayerPreview {

    public static final Identifier NO_SKIN_PONY = new Identifier("minelittlepony", "textures/mob/noskin.png");
    public static final Identifier NO_SKIN_SEAPONY = new Identifier("minelittlepony", "textures/mob/noskin_seapony.png");

    private final DummyPony localPony = new DummyPony(localTextures);
    private final DummyPony remotePony = new DummyPony(remoteTextures);

    public void setWet(boolean isWet) {
        localPony.setWet(isWet);
        remotePony.setWet(isWet);
    }

    @Override
    public Identifier getBlankSkin(Type type) {
        if (type == Type.SKIN) {
            // Initialization order means this method might be called before class members have been initialized.
            // This is something that needs to be fixed in HDSkins
            return localPony != null && localPony.wet ? NO_SKIN_SEAPONY : NO_SKIN_PONY;
        }
        return super.getBlankSkin(type);
    }

    protected DummyPlayer ponify(DummyPlayer human, DummyPlayer pony) {
        Identifier loc = human.getTextures().get(Type.SKIN).getId();

        if (loc == null || Pony.getBufferedImage(loc) == null) {
            return pony;
        }

        IPony thePony = MineLittlePony.getInstance().getManager().getPony(loc);

        Race race = thePony.getRace(true);

        if (race.isHuman()) {
            return human;
        }

        return pony;
    }

    @Override
    public DummyPlayer getRemote() {
        return ponify(super.getRemote(), remotePony);
    }


    @Override
    public DummyPlayer getLocal() {
        return ponify(super.getLocal(), localPony);
    }
}
{'fraction_non_alphanumeric': 0.09728788255785022, 'fraction_numerical': 0.0, 'mean_word_length': 3.276595744680851, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4370550', 'n_tokens_mistral': 1326, 'n_tokens_neox': 1289, 'n_words': 254}