2018-04-28 16:39:32 +02:00
|
|
|
package com.minelittlepony.model.player;
|
2015-08-02 00:36:33 +02:00
|
|
|
|
2017-06-13 05:55:50 +02:00
|
|
|
import com.minelittlepony.model.AbstractPonyModel;
|
2018-04-26 16:01:31 +02:00
|
|
|
import com.minelittlepony.render.PonyRenderer;
|
2018-04-25 12:59:18 +02:00
|
|
|
|
2016-05-10 21:10:29 +02:00
|
|
|
import net.minecraft.entity.Entity;
|
2016-11-25 05:40:19 +01:00
|
|
|
|
2018-04-28 16:39:32 +02:00
|
|
|
public class ModelEarthPony extends AbstractPonyModel {
|
2015-12-14 09:29:10 +01:00
|
|
|
|
2016-01-19 06:34:07 +01:00
|
|
|
private final boolean smallArms;
|
2018-04-27 13:49:33 +02:00
|
|
|
|
2018-04-29 11:56:26 +02:00
|
|
|
public PonyRenderer bipedCape;
|
2018-04-27 13:49:33 +02:00
|
|
|
|
2018-04-28 16:39:32 +02:00
|
|
|
public ModelEarthPony(boolean smallArms) {
|
2016-01-19 06:34:07 +01:00
|
|
|
super(smallArms);
|
|
|
|
this.smallArms = smallArms;
|
2015-12-14 09:29:10 +01:00
|
|
|
}
|
2018-04-27 13:49:33 +02:00
|
|
|
|
2015-08-02 00:36:33 +02:00
|
|
|
@Override
|
2018-04-27 13:49:33 +02:00
|
|
|
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);
|
2016-11-25 05:40:19 +01:00
|
|
|
|
2018-04-29 18:00:26 +02:00
|
|
|
if (bipedCape != null) {
|
|
|
|
bipedCape.rotationPointY = isSneak ? 2 : isRiding ? -4 : 0;
|
|
|
|
}
|
2015-08-02 00:36:33 +02:00
|
|
|
}
|
2018-04-27 13:49:33 +02:00
|
|
|
|
2018-04-29 14:22:26 +02:00
|
|
|
protected float getLegOutset() {
|
|
|
|
if (isCrouching() && smallArms) return 1;
|
|
|
|
return super.getLegOutset();
|
2018-04-25 16:40:47 +02:00
|
|
|
}
|
2018-04-27 13:49:33 +02:00
|
|
|
|
2018-04-29 14:22:26 +02:00
|
|
|
protected int getArmWidth() {
|
|
|
|
return smallArms ? 3 : super.getArmWidth();
|
2018-04-25 16:40:47 +02:00
|
|
|
}
|
2018-04-27 13:49:33 +02:00
|
|
|
|
2018-04-29 14:22:26 +02:00
|
|
|
protected float getLegRotationX() {
|
|
|
|
return smallArms ? 2 : super.getLegRotationX();
|
2015-08-02 00:36:33 +02:00
|
|
|
}
|
|
|
|
|
2018-04-29 14:22:26 +02:00
|
|
|
protected float getArmRotationY() {
|
|
|
|
return smallArms ? 8.5f : super.getArmRotationY();
|
2018-04-28 16:39:32 +02:00
|
|
|
}
|
|
|
|
|
2015-08-02 00:36:33 +02:00
|
|
|
protected void initHeadTextures() {
|
2018-04-29 14:22:26 +02:00
|
|
|
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) {
|
2018-04-29 14:22:26 +02:00
|
|
|
super.initHeadPositions(yOffset, stretch);
|
2018-04-26 16:01:31 +02:00
|
|
|
bipedCape.addBox(-5.0F, 0.0F, -1.0F, 10, 16, 1, stretch);
|
2018-04-27 23:23:47 +02:00
|
|
|
}
|
|
|
|
|
2015-08-02 00:36:33 +02:00
|
|
|
@Override
|
2015-08-13 00:22:21 +02:00
|
|
|
public void renderCape(float scale) {
|
2018-04-26 16:01:31 +02:00
|
|
|
bipedCape.render(scale);
|
2015-08-02 00:36:33 +02:00
|
|
|
}
|
|
|
|
}
|