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-06-05 20:18:57 +02:00
|
|
|
import com.minelittlepony.model.components.SaddleBags;
|
|
|
|
import com.minelittlepony.pony.data.PonyWearable;
|
2018-04-26 16:01:31 +02:00
|
|
|
import com.minelittlepony.render.PonyRenderer;
|
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-06-05 20:18:57 +02:00
|
|
|
public SaddleBags saddlebags;
|
|
|
|
|
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-05-01 12:38:13 +02:00
|
|
|
public void setRotationAngles(float move, float swing, float ticks, float headYaw, float headPitch, float scale, Entity entity) {
|
|
|
|
super.setRotationAngles(move, swing, ticks, 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-06-05 20:18:57 +02:00
|
|
|
@Override
|
|
|
|
protected void shakeBody(float move, float swing, float bodySwing, float ticks) {
|
|
|
|
super.shakeBody(move, swing, bodySwing, ticks);
|
|
|
|
saddlebags.setRotationAndAngles(rainboom, move, swing, bodySwing, ticks);
|
|
|
|
}
|
2018-06-08 01:04:43 +02:00
|
|
|
|
2018-06-05 20:18:57 +02:00
|
|
|
@Override
|
|
|
|
protected void renderBody(Entity entity, float move, float swing, float ticks, float headYaw, float headPitch, float scale) {
|
|
|
|
super.renderBody(entity, move, swing, ticks, headYaw, headPitch, scale);
|
2018-06-08 01:04:43 +02:00
|
|
|
|
2018-06-05 20:18:57 +02:00
|
|
|
if (isWearing(PonyWearable.SADDLE_BAGS)) {
|
|
|
|
saddlebags.renderPart(scale);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
protected void initTextures() {
|
|
|
|
super.initTextures();
|
|
|
|
saddlebags = new SaddleBags(this);
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
protected void initPositions(float yOffset, float stretch) {
|
|
|
|
super.initPositions(yOffset, stretch);
|
|
|
|
|
|
|
|
saddlebags.init(yOffset, stretch);
|
|
|
|
}
|
|
|
|
|
2018-04-29 14:22:26 +02:00
|
|
|
protected float getLegOutset() {
|
2018-04-29 23:06:34 +02:00
|
|
|
if (smallArms) {
|
|
|
|
if (isSleeping) return 2.6f;
|
|
|
|
if (isCrouching()) return 1;
|
|
|
|
return 4;
|
|
|
|
}
|
2018-04-29 14:22:26 +02:00
|
|
|
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
|
|
|
}
|
|
|
|
}
|