mirror of
https://github.com/MineLittlePony/MineLittlePony.git
synced 2025-02-16 17:44:23 +01:00
Unicorns will swing their arms to punch when not holding anything
This commit is contained in:
parent
ab3cd3f307
commit
a18b2a46d9
2 changed files with 9 additions and 5 deletions
|
@ -3,6 +3,7 @@ package com.minelittlepony.client.model;
|
||||||
import net.minecraft.client.model.Cuboid;
|
import net.minecraft.client.model.Cuboid;
|
||||||
import net.minecraft.client.render.entity.model.BipedEntityModel;
|
import net.minecraft.client.render.entity.model.BipedEntityModel;
|
||||||
import net.minecraft.client.render.entity.model.PlayerEntityModel;
|
import net.minecraft.client.render.entity.model.PlayerEntityModel;
|
||||||
|
import net.minecraft.client.render.entity.model.BipedEntityModel.ArmPose;
|
||||||
import net.minecraft.entity.LivingEntity;
|
import net.minecraft.entity.LivingEntity;
|
||||||
import net.minecraft.util.AbsoluteHand;
|
import net.minecraft.util.AbsoluteHand;
|
||||||
|
|
||||||
|
@ -85,6 +86,10 @@ public abstract class ClientPonyModel<T extends LivingEntity> extends PlayerEnti
|
||||||
return super.getArm(side);
|
return super.getArm(side);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public ArmPose getArmPoseForSide(AbsoluteHand side) {
|
||||||
|
return side == AbsoluteHand.RIGHT ? rightArmPose : leftArmPose;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Copies this model's attributes into the passed model.
|
* Copies this model's attributes into the passed model.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -45,10 +45,6 @@ public class ModelUnicorn<T extends LivingEntity> extends ModelEarthPony<T> impl
|
||||||
unicornArmLeft.rotate(0, 0, 0).around(-7, 12, -2);
|
unicornArmLeft.rotate(0, 0, 0).around(-7, 12, -2);
|
||||||
}
|
}
|
||||||
|
|
||||||
public ArmPose getArmPoseForSide(AbsoluteHand side) {
|
|
||||||
return side == AbsoluteHand.RIGHT ? rightArmPose : leftArmPose;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void animateBreathing(float ticks) {
|
protected void animateBreathing(float ticks) {
|
||||||
if (canCast()) {
|
if (canCast()) {
|
||||||
|
@ -124,6 +120,9 @@ public class ModelUnicorn<T extends LivingEntity> extends ModelEarthPony<T> impl
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Cuboid getArm(AbsoluteHand side) {
|
public Cuboid getArm(AbsoluteHand side) {
|
||||||
return canCast() ? getUnicornArmForSide(side) : super.getArm(side);
|
if (canCast() && getArmPoseForSide(side) != ArmPose.EMPTY) {
|
||||||
|
return getUnicornArmForSide(side);
|
||||||
|
}
|
||||||
|
return super.getArm(side);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue