MineLittlePony/src/main/java/com/minelittlepony/model/player/ModelEarthPony.java

74 lines
2 KiB
Java
Raw Normal View History

package com.minelittlepony.model.player;
2015-08-02 00:36:33 +02:00
import com.minelittlepony.model.AbstractPonyModel;
2018-04-26 16:01:31 +02:00
import com.minelittlepony.render.PonyRenderer;
import net.minecraft.entity.Entity;
2016-11-25 05:40:19 +01:00
public class ModelEarthPony extends AbstractPonyModel {
private final boolean smallArms;
2018-04-29 11:56:26 +02:00
public PonyRenderer bipedCape;
public ModelEarthPony(boolean smallArms) {
super(smallArms);
this.smallArms = smallArms;
}
2015-08-02 00:36:33 +02:00
@Override
public void setRotationAngles(float move, float swing, float age, float headYaw, float headPitch, float scale, Entity entity) {
super.setRotationAngles(move, swing, age, headYaw, headPitch, scale, entity);
bipedCape.rotationPointY = isSneak ? 2 : isRiding ? -4 : 0;
2015-08-02 00:36:33 +02:00
}
protected float getLegOutset() {
if (isCrouching() && smallArms) return 1;
return super.getLegOutset();
}
protected int getArmWidth() {
return smallArms ? 3 : super.getArmWidth();
}
protected float getLegRotationX() {
return smallArms ? 2 : super.getLegRotationX();
2015-08-02 00:36:33 +02:00
}
protected float getArmRotationY() {
return smallArms ? 8.5f : super.getArmRotationY();
}
protected void adjustLegs(float move, float swing, float tick) {
super.adjustLegs(move, swing, tick);
// Push the front legs back apart if we're a thin pony
if (smallArms) {
bipedLeftArm.rotationPointX++;
bipedLeftLeg.rotationPointX++;
}
2015-08-02 00:36:33 +02:00
}
protected void initHeadTextures() {
super.initHeadTextures();
2018-04-26 16:01:31 +02:00
bipedCape = new PonyRenderer(this, 0, 0).size(64, 32);
2015-08-02 00:36:33 +02:00
}
protected void initHeadPositions(float yOffset, float stretch) {
super.initHeadPositions(yOffset, stretch);
2018-04-26 16:01:31 +02:00
bipedCape.addBox(-5.0F, 0.0F, -1.0F, 10, 16, 1, stretch);
}
2015-08-02 00:36:33 +02:00
protected void initLegPositions(float yOffset, float stretch) {
super.initLegPositions(yOffset, stretch);
if (smallArms) {
2015-08-02 00:36:33 +02:00
}
}
@Override
public void renderCape(float scale) {
2018-04-26 16:01:31 +02:00
bipedCape.render(scale);
2015-08-02 00:36:33 +02:00
}
}