mirror of
https://github.com/MineLittlePony/MineLittlePony.git
synced 2024-11-25 13:57:59 +01:00
Fixed armour stands using the same angles for front and back legs. Closes #199
They should now only mirror the front legs if the angles are the default.
This commit is contained in:
parent
9a97227818
commit
47022fc1e8
1 changed files with 13 additions and 4 deletions
|
@ -4,10 +4,13 @@ import net.minecraft.client.model.ModelPart;
|
||||||
import net.minecraft.client.render.entity.model.ArmorStandEntityModel;
|
import net.minecraft.client.render.entity.model.ArmorStandEntityModel;
|
||||||
import net.minecraft.client.render.entity.model.BipedEntityModel;
|
import net.minecraft.client.render.entity.model.BipedEntityModel;
|
||||||
import net.minecraft.entity.decoration.ArmorStandEntity;
|
import net.minecraft.entity.decoration.ArmorStandEntity;
|
||||||
|
import net.minecraft.util.math.EulerAngle;
|
||||||
|
|
||||||
import com.minelittlepony.mson.util.PartUtil;
|
import com.minelittlepony.mson.util.PartUtil;
|
||||||
|
|
||||||
public class PonyArmourStandModel extends ArmorStandEntityModel {
|
public class PonyArmourStandModel extends ArmorStandEntityModel {
|
||||||
|
private static final EulerAngle DEFAULT_LEFT_LEG_ROTATION = new EulerAngle(-1, 0, -1);
|
||||||
|
private static final EulerAngle DEFAULT_RIGHT_LEG_ROTATION = new EulerAngle(1, 0, 1);
|
||||||
|
|
||||||
public PonyArmourStandModel(ModelPart modelPart) {
|
public PonyArmourStandModel(ModelPart modelPart) {
|
||||||
super(modelPart);
|
super(modelPart);
|
||||||
|
@ -19,12 +22,18 @@ public class PonyArmourStandModel extends ArmorStandEntityModel {
|
||||||
leftArm.visible = true;
|
leftArm.visible = true;
|
||||||
rightArm.visible = true;
|
rightArm.visible = true;
|
||||||
|
|
||||||
PartUtil.copyAngles(leftArm, leftLeg);
|
|
||||||
PartUtil.copyAngles(rightArm, rightLeg);
|
|
||||||
|
|
||||||
|
|
||||||
|
if (entity.getLeftLegRotation().equals(DEFAULT_LEFT_LEG_ROTATION)) {
|
||||||
|
PartUtil.copyAngles(leftArm, leftLeg);
|
||||||
leftLeg.pitch *= -1;
|
leftLeg.pitch *= -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (entity.getRightLegRotation().equals(DEFAULT_RIGHT_LEG_ROTATION)) {
|
||||||
|
PartUtil.copyAngles(rightArm, rightLeg);
|
||||||
rightLeg.pitch *= -1;
|
rightLeg.pitch *= -1;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void applyAnglesTo(BipedEntityModel<ArmorStandEntity> dest) {
|
public void applyAnglesTo(BipedEntityModel<ArmorStandEntity> dest) {
|
||||||
PartUtil.copyAngles(head, dest.head);
|
PartUtil.copyAngles(head, dest.head);
|
||||||
|
|
Loading…
Reference in a new issue