diff --git a/src/main/java/com/minelittlepony/model/gear/AbstractGear.java b/src/main/java/com/minelittlepony/model/gear/AbstractGear.java index 23d8f9b0..68b862f4 100644 --- a/src/main/java/com/minelittlepony/model/gear/AbstractGear.java +++ b/src/main/java/com/minelittlepony/model/gear/AbstractGear.java @@ -25,9 +25,9 @@ public abstract class AbstractGear extends ModelBase implements IGear, PonyModel public ModelRenderer getOriginBodyPart(AbstractPonyModel model) { switch (getGearLocation()) { default: - case HEAD: return model.bipedHead; + case HEAD: return model.getHead(); + case NECK: return model.neck; case TAIL: - case NECK: case LEGS: case BODY: return model.bipedBody; } diff --git a/src/main/java/com/minelittlepony/model/gear/IGear.java b/src/main/java/com/minelittlepony/model/gear/IGear.java index 8cd5898d..8f7ae609 100644 --- a/src/main/java/com/minelittlepony/model/gear/IGear.java +++ b/src/main/java/com/minelittlepony/model/gear/IGear.java @@ -45,7 +45,9 @@ public interface IGear extends IModelPart { /** * Orients this wearable. */ - void setLivingAnimations(IModel model, Entity entity); + default void setLivingAnimations(IModel model, Entity entity) { + + } /** * Renders this wearable separately. (used outside of the gear render layer) diff --git a/src/main/java/com/minelittlepony/model/gear/Muffin.java b/src/main/java/com/minelittlepony/model/gear/Muffin.java index 411ffbae..7e47b811 100644 --- a/src/main/java/com/minelittlepony/model/gear/Muffin.java +++ b/src/main/java/com/minelittlepony/model/gear/Muffin.java @@ -30,10 +30,6 @@ public class Muffin extends AbstractGear { crown.render(scale); } - @Override - public void setLivingAnimations(IModel model, Entity entity) { - } - @Override public boolean canRender(IModel model, Entity entity) { return model.isWearing(PonyWearable.MUFFIN); diff --git a/src/main/java/com/minelittlepony/model/gear/Stetson.java b/src/main/java/com/minelittlepony/model/gear/Stetson.java new file mode 100644 index 00000000..bfc71d2e --- /dev/null +++ b/src/main/java/com/minelittlepony/model/gear/Stetson.java @@ -0,0 +1,54 @@ +package com.minelittlepony.model.gear; + +import net.minecraft.entity.Entity; +import net.minecraft.util.ResourceLocation; + +import com.minelittlepony.model.BodyPart; +import com.minelittlepony.model.capabilities.IModel; +import com.minelittlepony.render.model.PlaneRenderer; +import com.minelittlepony.render.model.PonyRenderer; + +public class Stetson extends AbstractGear { + private static final ResourceLocation TEXTURE = new ResourceLocation("minelittlepony", "textures/models/stetson.png"); + + private PlaneRenderer rimshot; + + @Override + public void init(float yOffset, float stretch) { + rimshot = new PlaneRenderer(this).size(64, 64) + .tex(16, 33).top(-9, yOffset - 4, -12, 16, 17, stretch) + .tex(0, 33).bottom(-9, yOffset - 3.999F, -12, 16, 17, stretch) + .rotate(-0.3F, 0, 0.1F) + .child(new PonyRenderer(this).size(64, 64) + .tex(0, 0).box(-5, yOffset - 8, -6, 9, 4, 9, stretch) + .tex(0, 13).box(-6, yOffset - 6, -7, 11, 2, 11, stretch)); + + rimshot.child() + .around(-9, yOffset - 4, -12) + .tex(0, 27).south(0, yOffset - 6, 0, 16, 6, stretch) + .rotate(0.4F, 0, 0); + } + + @Override + public BodyPart getGearLocation() { + return BodyPart.HEAD; + } + + @Override + public ResourceLocation getTexture(Entity entity) { + return TEXTURE; + } + + @Override + public void renderPart(float scale) { + this.boxList.clear(); + this.init(0, 0); + rimshot.render(scale); + } + + @Override + public boolean canRender(IModel model, Entity entity) { + return true;//model.isWearing(PonyWearable.STETSON); + } + +} diff --git a/src/main/java/com/minelittlepony/model/gear/WitchHat.java b/src/main/java/com/minelittlepony/model/gear/WitchHat.java index d5a77f2f..88cb6e73 100644 --- a/src/main/java/com/minelittlepony/model/gear/WitchHat.java +++ b/src/main/java/com/minelittlepony/model/gear/WitchHat.java @@ -19,11 +19,6 @@ public class WitchHat extends AbstractGear { witchHat.render(scale * 1.3F); } - @Override - public void setLivingAnimations(IModel model, Entity entity) { - - } - @Override public void init(float yOffset, float stretch) { witchHat = new PonyRenderer(this).size(64, 128); diff --git a/src/main/java/com/minelittlepony/pony/data/PonyWearable.java b/src/main/java/com/minelittlepony/pony/data/PonyWearable.java index 885871b2..fe3bc9bd 100644 --- a/src/main/java/com/minelittlepony/pony/data/PonyWearable.java +++ b/src/main/java/com/minelittlepony/pony/data/PonyWearable.java @@ -7,7 +7,8 @@ public enum PonyWearable implements ITriggerPixelMapped { NONE(0), SADDLE_BAGS(200), MUFFIN(50), - HAT(100); + HAT(100), + STETSON(250); private int triggerValue; diff --git a/src/main/java/com/minelittlepony/render/layer/LayerGear.java b/src/main/java/com/minelittlepony/render/layer/LayerGear.java index 0dee004b..e1536b2b 100644 --- a/src/main/java/com/minelittlepony/render/layer/LayerGear.java +++ b/src/main/java/com/minelittlepony/render/layer/LayerGear.java @@ -12,6 +12,7 @@ import com.minelittlepony.model.AbstractPonyModel; import com.minelittlepony.model.gear.IGear; import com.minelittlepony.model.gear.Muffin; import com.minelittlepony.model.gear.SaddleBags; +import com.minelittlepony.model.gear.Stetson; import com.minelittlepony.model.gear.WitchHat; import java.util.List; @@ -21,7 +22,8 @@ public class LayerGear extends AbstractPonyLayer private static List gears = Lists.newArrayList( new SaddleBags(), new WitchHat(), - new Muffin() + new Muffin(), + new Stetson() ); public LayerGear(RenderLivingBase renderer) { diff --git a/src/main/resources/assets/minelittlepony/textures/models/stetson.png b/src/main/resources/assets/minelittlepony/textures/models/stetson.png new file mode 100644 index 00000000..f935af5b Binary files /dev/null and b/src/main/resources/assets/minelittlepony/textures/models/stetson.png differ