diff --git a/src/main/java/com/minelittlepony/client/model/components/ModelPonyHead.java b/src/main/java/com/minelittlepony/client/model/components/ModelPonyHead.java index 3df2218d..b6f83543 100644 --- a/src/main/java/com/minelittlepony/client/model/components/ModelPonyHead.java +++ b/src/main/java/com/minelittlepony/client/model/components/ModelPonyHead.java @@ -53,7 +53,7 @@ public class ModelPonyHead extends SkullOverlayEntityModel implements ICapitated super.render(move, swing, ticks, headYaw, headPitch, scale); - if (metadata.hasMagic()) { + if (metadata.hasHorn()) { getHead().applyTransform(scale); horn.renderPart(scale, null); } diff --git a/src/main/java/com/minelittlepony/client/model/races/ModelUnicorn.java b/src/main/java/com/minelittlepony/client/model/races/ModelUnicorn.java index 93e7236a..c1ab2c74 100644 --- a/src/main/java/com/minelittlepony/client/model/races/ModelUnicorn.java +++ b/src/main/java/com/minelittlepony/client/model/races/ModelUnicorn.java @@ -86,10 +86,10 @@ public class ModelUnicorn extends ModelEarthPony impl protected void renderHead(float scale) { super.renderHead(scale); - if (canCast()) { + if (hasHorn()) { head.applyTransform(scale); horn.renderPart(scale, attributes.interpolatorId); - if (isCasting()) { + if (canCast() && isCasting()) { horn.renderMagic(getMagicColor(), scale); } } diff --git a/src/main/java/com/minelittlepony/client/pony/PonyData.java b/src/main/java/com/minelittlepony/client/pony/PonyData.java index e61202f9..f1cd86a8 100644 --- a/src/main/java/com/minelittlepony/client/pony/PonyData.java +++ b/src/main/java/com/minelittlepony/client/pony/PonyData.java @@ -122,9 +122,14 @@ public class PonyData implements IPonyData { return glowColor; } + @Override + public boolean hasHorn() { + return getRace() != null && getRace().getEffectiveRace(false).hasHorn(); + } + @Override public boolean hasMagic() { - return getRace() != null && getRace().getEffectiveRace(false).hasHorn() && getGlowColor() != 0; + return hasHorn() && getGlowColor() != 0; } @Override diff --git a/src/main/java/com/minelittlepony/model/IUnicorn.java b/src/main/java/com/minelittlepony/model/IUnicorn.java index 38d393a2..d6f5b159 100644 --- a/src/main/java/com/minelittlepony/model/IUnicorn.java +++ b/src/main/java/com/minelittlepony/model/IUnicorn.java @@ -15,6 +15,13 @@ public interface IUnicorn extends IModel { return getMetadata().hasMagic(); } + /** + * Returns true if this model has an visible horns. + */ + default boolean hasHorn() { + return getMetadata().hasHorn(); + } + /** * Returns true if this model is currently using magic (horn is lit). * @return diff --git a/src/main/java/com/minelittlepony/pony/IPonyData.java b/src/main/java/com/minelittlepony/pony/IPonyData.java index c532fde4..a88e5efe 100644 --- a/src/main/java/com/minelittlepony/pony/IPonyData.java +++ b/src/main/java/com/minelittlepony/pony/IPonyData.java @@ -38,6 +38,11 @@ public interface IPonyData { */ int getGlowColor(); + /** + * Returns true if and only if this metadata represents a pony that has a horn. + */ + boolean hasHorn(); + /** * Returns true if and only if this metadata represents a pony that can cast magic. */