diff --git a/src/main/java/com/minelittlepony/client/model/gear/AbstractGear.java b/src/main/java/com/minelittlepony/client/model/gear/AbstractGear.java index 74118090..22ca03a4 100644 --- a/src/main/java/com/minelittlepony/client/model/gear/AbstractGear.java +++ b/src/main/java/com/minelittlepony/client/model/gear/AbstractGear.java @@ -7,12 +7,13 @@ import net.minecraft.client.render.VertexConsumer; import net.minecraft.client.util.math.MatrixStack; import com.minelittlepony.model.gear.IGear; +import com.minelittlepony.mson.api.MsonModel; import java.util.ArrayList; import java.util.List; import java.util.UUID; -public abstract class AbstractGear extends Model implements IGear { +public abstract class AbstractGear extends Model implements IGear, MsonModel { private final List parts = new ArrayList<>(); diff --git a/src/main/java/com/minelittlepony/client/model/gear/ChristmasHat.java b/src/main/java/com/minelittlepony/client/model/gear/ChristmasHat.java index 01a34f84..a2a31676 100644 --- a/src/main/java/com/minelittlepony/client/model/gear/ChristmasHat.java +++ b/src/main/java/com/minelittlepony/client/model/gear/ChristmasHat.java @@ -9,6 +9,7 @@ import net.minecraft.util.math.MathHelper; import com.minelittlepony.model.BodyPart; import com.minelittlepony.model.IModel; +import com.minelittlepony.mson.api.ModelContext; import com.minelittlepony.pony.meta.Wearable; import com.minelittlepony.util.math.Color; @@ -38,6 +39,12 @@ public class ChristmasHat extends AbstractGear { private int tint; + @Override + public void init(ModelContext context) { + left = context.findByName("left"); + right = context.findByName("right"); + } + @Override public boolean canRender(IModel model, Entity entity) { return isChristmasDay() || model.isWearing(Wearable.ANTLERS); diff --git a/src/main/java/com/minelittlepony/client/model/gear/Muffin.java b/src/main/java/com/minelittlepony/client/model/gear/Muffin.java index f47e8ab2..bc814cf4 100644 --- a/src/main/java/com/minelittlepony/client/model/gear/Muffin.java +++ b/src/main/java/com/minelittlepony/client/model/gear/Muffin.java @@ -6,12 +6,18 @@ import net.minecraft.util.Identifier; import com.minelittlepony.model.BodyPart; import com.minelittlepony.model.IModel; import com.minelittlepony.model.gear.IStackable; +import com.minelittlepony.mson.api.ModelContext; import com.minelittlepony.pony.meta.Wearable; public class Muffin extends AbstractGear implements IStackable { private static final Identifier TEXTURE = new Identifier("minelittlepony", "textures/models/muffin.png"); + @Override + public void init(ModelContext context) { + accept(context.findByName("crown")); + } + @Override public boolean canRender(IModel model, Entity entity) { return model.isWearing(Wearable.MUFFIN); diff --git a/src/main/java/com/minelittlepony/client/model/gear/SaddleBags.java b/src/main/java/com/minelittlepony/client/model/gear/SaddleBags.java index d91241df..183b99da 100644 --- a/src/main/java/com/minelittlepony/client/model/gear/SaddleBags.java +++ b/src/main/java/com/minelittlepony/client/model/gear/SaddleBags.java @@ -4,6 +4,7 @@ import com.minelittlepony.client.util.render.Part; import com.minelittlepony.model.BodyPart; import com.minelittlepony.model.IModel; import com.minelittlepony.model.IPegasus; +import com.minelittlepony.mson.api.ModelContext; import com.minelittlepony.pony.meta.Race; import com.minelittlepony.pony.meta.Wearable; @@ -32,6 +33,13 @@ public class SaddleBags extends AbstractGear { private IModel model; + @Override + public void init(ModelContext context) { + strap = context.findByName("strap"); + leftBag = context.findByName("left_bag"); + rightBag = context.findByName("right_bag"); + } + @Deprecated public void init(float yOffset, float stretch) { leftBag = new Part(this, 56, 19); diff --git a/src/main/java/com/minelittlepony/client/model/gear/Stetson.java b/src/main/java/com/minelittlepony/client/model/gear/Stetson.java index 2ae3f468..0fc59f9d 100644 --- a/src/main/java/com/minelittlepony/client/model/gear/Stetson.java +++ b/src/main/java/com/minelittlepony/client/model/gear/Stetson.java @@ -6,11 +6,17 @@ import net.minecraft.util.Identifier; import com.minelittlepony.model.BodyPart; import com.minelittlepony.model.IModel; import com.minelittlepony.model.gear.IStackable; +import com.minelittlepony.mson.api.ModelContext; import com.minelittlepony.pony.meta.Wearable; public class Stetson extends AbstractGear implements IStackable { private static final Identifier TEXTURE = new Identifier("minelittlepony", "textures/models/stetson.png"); + @Override + public void init(ModelContext context) { + accept(context.findByName("rim")); + } + @Override public BodyPart getGearLocation() { return BodyPart.HEAD; diff --git a/src/main/java/com/minelittlepony/client/model/gear/WitchHat.java b/src/main/java/com/minelittlepony/client/model/gear/WitchHat.java index 78e1aec6..b36a93b6 100644 --- a/src/main/java/com/minelittlepony/client/model/gear/WitchHat.java +++ b/src/main/java/com/minelittlepony/client/model/gear/WitchHat.java @@ -8,6 +8,7 @@ import com.minelittlepony.client.util.render.Part; import com.minelittlepony.model.BodyPart; import com.minelittlepony.model.IModel; import com.minelittlepony.model.gear.IStackable; +import com.minelittlepony.mson.api.ModelContext; import com.minelittlepony.pony.meta.Wearable; public class WitchHat extends AbstractGear implements IStackable { @@ -16,6 +17,12 @@ public class WitchHat extends AbstractGear implements IStackable { private ModelPart witchHat; + + @Override + public void init(ModelContext context) { + witchHat = context.findByName("witch_hat"); + } + @Deprecated public void init(float yOffset, float stretch) { accept(witchHat = new Part(this).size(64, 128));