mirror of
https://github.com/MineLittlePony/MineLittlePony.git
synced 2024-11-22 20:47:59 +01:00
Add stetsons
This commit is contained in:
parent
f25c269360
commit
0a171b6a56
8 changed files with 64 additions and 14 deletions
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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);
|
||||
|
|
54
src/main/java/com/minelittlepony/model/gear/Stetson.java
Normal file
54
src/main/java/com/minelittlepony/model/gear/Stetson.java
Normal 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);
|
||||
}
|
||||
|
||||
}
|
|
@ -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);
|
||||
|
|
|
@ -7,7 +7,8 @@ public enum PonyWearable implements ITriggerPixelMapped<PonyWearable> {
|
|||
NONE(0),
|
||||
SADDLE_BAGS(200),
|
||||
MUFFIN(50),
|
||||
HAT(100);
|
||||
HAT(100),
|
||||
STETSON(250);
|
||||
|
||||
private int triggerValue;
|
||||
|
||||
|
|
|
@ -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<T extends EntityLivingBase> extends AbstractPonyLayer<T>
|
|||
private static List<IGear> gears = Lists.newArrayList(
|
||||
new SaddleBags(),
|
||||
new WitchHat(),
|
||||
new Muffin()
|
||||
new Muffin(),
|
||||
new Stetson()
|
||||
);
|
||||
|
||||
public LayerGear(RenderLivingBase<T> renderer) {
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 617 B |
Loading…
Reference in a new issue