mirror of
https://github.com/MineLittlePony/MineLittlePony.git
synced 2024-11-29 23:48:00 +01:00
Fixed skeleton legs not swinging
This commit is contained in:
parent
af3dff6c87
commit
d233399b68
1 changed files with 19 additions and 8 deletions
|
@ -7,6 +7,7 @@ import com.minelittlepony.model.armour.ModelSkeletonPonyArmor;
|
||||||
import com.minelittlepony.model.armour.PonyArmor;
|
import com.minelittlepony.model.armour.PonyArmor;
|
||||||
|
|
||||||
import net.minecraft.client.model.ModelBiped;
|
import net.minecraft.client.model.ModelBiped;
|
||||||
|
import net.minecraft.client.model.ModelRenderer;
|
||||||
import net.minecraft.entity.Entity;
|
import net.minecraft.entity.Entity;
|
||||||
import net.minecraft.entity.EntityLivingBase;
|
import net.minecraft.entity.EntityLivingBase;
|
||||||
import net.minecraft.entity.monster.AbstractSkeleton;
|
import net.minecraft.entity.monster.AbstractSkeleton;
|
||||||
|
@ -55,31 +56,41 @@ public class ModelSkeletonPony extends ModelMobPony {
|
||||||
bipedRightArm.setRotationPoint(-1.5F, 9.5F, 4);
|
bipedRightArm.setRotationPoint(-1.5F, 9.5F, 4);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO: HACK It would be better to just change the size of the legs.
|
||||||
|
private void renderScaledArm(ModelRenderer arm, float x, float y, float z) {
|
||||||
|
scale(x, y, z);
|
||||||
|
x /= 1.5f;
|
||||||
|
z /= 1.5f;
|
||||||
|
arm.rotateAngleX /= x;
|
||||||
|
arm.rotateAngleY /= y;
|
||||||
|
arm.rotateAngleZ /= z;
|
||||||
|
arm.render(scale);
|
||||||
|
arm.rotateAngleX *= x;
|
||||||
|
arm.rotateAngleY *= y;
|
||||||
|
arm.rotateAngleZ *= z;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void renderLegs() {
|
protected void renderLegs() {
|
||||||
pushMatrix();
|
pushMatrix();
|
||||||
translate(0.05F, -0.21F, 0);
|
translate(0.05F, -0.21F, 0);
|
||||||
scale(0.5F, 1.15F, 0.5F);
|
renderScaledArm(bipedLeftArm, 0.5F, 1.15F, 0.5F);
|
||||||
bipedLeftArm.render(this.scale);
|
|
||||||
popMatrix();
|
popMatrix();
|
||||||
|
|
||||||
pushMatrix();
|
pushMatrix();
|
||||||
translate(-0.05F, -0.21F, 0);
|
translate(-0.05F, -0.21F, 0);
|
||||||
scale(0.5F, 1.2F, 0.5F);
|
renderScaledArm(bipedRightArm, 0.5F, 1.2F, 0.5F);
|
||||||
bipedRightArm.render(this.scale);
|
|
||||||
popMatrix();
|
popMatrix();
|
||||||
|
|
||||||
pushMatrix();
|
pushMatrix();
|
||||||
translate(0.05F, -0.21F, 0.35F);
|
translate(0.05F, -0.21F, 0.35F);
|
||||||
scale(0.5F, 1.2F, 0.5F);
|
renderScaledArm(bipedLeftLeg, 0.5F, 1.2F, 0.5F);
|
||||||
bipedLeftLeg.render(this.scale);
|
|
||||||
popMatrix();
|
popMatrix();
|
||||||
|
|
||||||
pushMatrix();
|
pushMatrix();
|
||||||
translate(-0.05F, -0.21F, 0.35F);
|
translate(-0.05F, -0.21F, 0.35F);
|
||||||
scale(0.5F, 1.15F, 0.5F);
|
renderScaledArm(bipedRightLeg, 0.5F, 1.15F, 0.5F);
|
||||||
bipedRightLeg.render(this.scale);
|
|
||||||
popMatrix();
|
popMatrix();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue