diff --git a/src/main/java/com/minelittlepony/api/pony/meta/Race.java b/src/main/java/com/minelittlepony/api/pony/meta/Race.java index b7cc0030..0f244389 100644 --- a/src/main/java/com/minelittlepony/api/pony/meta/Race.java +++ b/src/main/java/com/minelittlepony/api/pony/meta/Race.java @@ -36,7 +36,6 @@ public enum Race implements TriggerPixelType { /** * Returns true if this pony has a horn (and by extension can cast magic). - * @return */ public boolean hasHorn() { return horn; @@ -50,12 +49,26 @@ public enum Race implements TriggerPixelType { } /** - * Returns true if this is a human. + * Returns true if this a changeling or reformed changeling. + */ + public boolean hasBugWings() { + return this == CHANGELING || this == CHANGEDLING; + } + + /** + * Returns true if this is not a pony. */ public boolean isHuman() { return this == HUMAN; } + /** + * Returns true if the model allows embedding saddlebags in the main body texture. + */ + public boolean supportsLegacySaddlebags() { + return !(this == BATPONY || hasBugWings()); + } + @Override public int getColorCode() { return triggerPixel; diff --git a/src/main/java/com/minelittlepony/client/hdskins/MineLPHDSkins.java b/src/main/java/com/minelittlepony/client/hdskins/MineLPHDSkins.java index 45e188dc..3e21a8b1 100644 --- a/src/main/java/com/minelittlepony/client/hdskins/MineLPHDSkins.java +++ b/src/main/java/com/minelittlepony/client/hdskins/MineLPHDSkins.java @@ -106,7 +106,7 @@ public class MineLPHDSkins extends SkinsProxy implements ClientModInitializer { IPonyData metadata = IPony.getManager().getPony(main.getId()).metadata(); if (wearable != Wearable.NONE && metadata.isWearing(wearable)) { - if (wearable.isSaddlebags() && metadata.getRace() != Race.BATPONY) { + if (wearable.isSaddlebags() && metadata.getRace().supportsLegacySaddlebags()) { return Optional.of(main.getId()); } diff --git a/src/main/java/com/minelittlepony/client/model/part/PonyWings.java b/src/main/java/com/minelittlepony/client/model/part/PonyWings.java index 8d047ec3..71b21905 100644 --- a/src/main/java/com/minelittlepony/client/model/part/PonyWings.java +++ b/src/main/java/com/minelittlepony/client/model/part/PonyWings.java @@ -7,7 +7,6 @@ import net.minecraft.client.util.math.MatrixStack; import net.minecraft.util.math.MathHelper; import com.minelittlepony.api.model.*; -import com.minelittlepony.api.pony.meta.Race; import com.minelittlepony.api.pony.meta.Wearable; import com.minelittlepony.mson.api.ModelView; import com.minelittlepony.mson.api.MsonModel; @@ -120,16 +119,14 @@ public class PonyWings implements IPart, MsonModel { public void rotateWalking(float swing) { folded.yaw = swing * walkingRotationSpeed; - Race race = pegasus.getMetadata().getRace(); - if (race == Race.CHANGELING || race == Race.CHANGEDLING) { + if (pegasus.getMetadata().getRace().hasBugWings()) { extended.yaw = folded.yaw; } } public void rotateFlying(float roll) { extended.roll = roll; - Race race = pegasus.getMetadata().getRace(); - if (race == Race.CHANGELING || race == Race.CHANGEDLING) { + if (pegasus.getMetadata().getRace().hasBugWings()) { folded.roll = roll; } } diff --git a/src/main/java/com/minelittlepony/client/render/entity/PlayerPonyRenderer.java b/src/main/java/com/minelittlepony/client/render/entity/PlayerPonyRenderer.java index c6035c37..e90b5bc5 100644 --- a/src/main/java/com/minelittlepony/client/render/entity/PlayerPonyRenderer.java +++ b/src/main/java/com/minelittlepony/client/render/entity/PlayerPonyRenderer.java @@ -2,7 +2,6 @@ package com.minelittlepony.client.render.entity; import com.minelittlepony.api.model.ModelAttributes; import com.minelittlepony.api.pony.IPony; -import com.minelittlepony.api.pony.meta.Race; import com.minelittlepony.api.pony.meta.Wearable; import com.minelittlepony.client.SkinsProxy; import com.minelittlepony.client.model.*; @@ -183,10 +182,7 @@ public class PlayerPonyRenderer extends PlayerEntityRenderer implements IPonyRen @Override public Identifier getDefaultTexture(AbstractClientPlayerEntity entity, Wearable wearable) { return SkinsProxy.instance.getSkin(wearable.getId(), entity).orElseGet(() -> { - if (wearable.isSaddlebags()) { - if (getInternalRenderer().getModel().getMetadata().getRace() == Race.BATPONY) { - return wearable.getDefaultTexture(); - } + if (wearable.isSaddlebags() && getInternalRenderer().getModel().getMetadata().getRace().supportsLegacySaddlebags()) { return manager.getTexture(entity); }