diff --git a/src/main/java/eu/ha3/presencefootsteps/sound/generator/MineLP.java b/src/main/java/eu/ha3/presencefootsteps/sound/generator/MineLP.java index 53dd195b..df225e80 100644 --- a/src/main/java/eu/ha3/presencefootsteps/sound/generator/MineLP.java +++ b/src/main/java/eu/ha3/presencefootsteps/sound/generator/MineLP.java @@ -1,5 +1,7 @@ package eu.ha3.presencefootsteps.sound.generator; +import org.jetbrains.annotations.Nullable; + import com.minelittlepony.api.pony.meta.Race; import com.minelittlepony.client.MineLittlePony; @@ -24,8 +26,14 @@ public static boolean hasPonies() { public static Locomotion getLocomotion(Entity entity, Locomotion fallback) { + @Nullable Identifier texture = MinecraftClient.getInstance().getEntityRenderDispatcher().getRenderer(entity).getTexture(entity); + if (texture == null) { + // Bad modder. /slap + return fallback; + } + Race race = MineLittlePony.getInstance().getManager().getPony(texture).race(); if (race.isHuman()) {