Add stetsons

This commit is contained in:
Sollace 2018-09-10 15:40:56 +02:00
parent f25c269360
commit 0a171b6a56
8 changed files with 64 additions and 14 deletions

View file

@ -25,9 +25,9 @@ public abstract class AbstractGear extends ModelBase implements IGear, PonyModel
public ModelRenderer getOriginBodyPart(AbstractPonyModel model) { public ModelRenderer getOriginBodyPart(AbstractPonyModel model) {
switch (getGearLocation()) { switch (getGearLocation()) {
default: default:
case HEAD: return model.bipedHead; case HEAD: return model.getHead();
case NECK: return model.neck;
case TAIL: case TAIL:
case NECK:
case LEGS: case LEGS:
case BODY: return model.bipedBody; case BODY: return model.bipedBody;
} }

View file

@ -45,7 +45,9 @@ public interface IGear extends IModelPart {
/** /**
* Orients this wearable. * 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) * Renders this wearable separately. (used outside of the gear render layer)

View file

@ -30,10 +30,6 @@ public class Muffin extends AbstractGear {
crown.render(scale); crown.render(scale);
} }
@Override
public void setLivingAnimations(IModel model, Entity entity) {
}
@Override @Override
public boolean canRender(IModel model, Entity entity) { public boolean canRender(IModel model, Entity entity) {
return model.isWearing(PonyWearable.MUFFIN); return model.isWearing(PonyWearable.MUFFIN);

View file

@ -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);
}
}

View file

@ -19,11 +19,6 @@ public class WitchHat extends AbstractGear {
witchHat.render(scale * 1.3F); witchHat.render(scale * 1.3F);
} }
@Override
public void setLivingAnimations(IModel model, Entity entity) {
}
@Override @Override
public void init(float yOffset, float stretch) { public void init(float yOffset, float stretch) {
witchHat = new PonyRenderer(this).size(64, 128); witchHat = new PonyRenderer(this).size(64, 128);

View file

@ -7,7 +7,8 @@ public enum PonyWearable implements ITriggerPixelMapped<PonyWearable> {
NONE(0), NONE(0),
SADDLE_BAGS(200), SADDLE_BAGS(200),
MUFFIN(50), MUFFIN(50),
HAT(100); HAT(100),
STETSON(250);
private int triggerValue; private int triggerValue;

View file

@ -12,6 +12,7 @@ import com.minelittlepony.model.AbstractPonyModel;
import com.minelittlepony.model.gear.IGear; import com.minelittlepony.model.gear.IGear;
import com.minelittlepony.model.gear.Muffin; import com.minelittlepony.model.gear.Muffin;
import com.minelittlepony.model.gear.SaddleBags; import com.minelittlepony.model.gear.SaddleBags;
import com.minelittlepony.model.gear.Stetson;
import com.minelittlepony.model.gear.WitchHat; import com.minelittlepony.model.gear.WitchHat;
import java.util.List; import java.util.List;
@ -21,7 +22,8 @@ public class LayerGear<T extends EntityLivingBase> extends AbstractPonyLayer<T>
private static List<IGear> gears = Lists.newArrayList( private static List<IGear> gears = Lists.newArrayList(
new SaddleBags(), new SaddleBags(),
new WitchHat(), new WitchHat(),
new Muffin() new Muffin(),
new Stetson()
); );
public LayerGear(RenderLivingBase<T> renderer) { public LayerGear(RenderLivingBase<T> renderer) {

Binary file not shown.

After

Width:  |  Height:  |  Size: 617 B