Fixed piglin helmets not aligning with their heads

This commit is contained in:
Sollace 2020-03-27 21:09:33 +02:00
parent 8692c124c0
commit 0d18697a67
3 changed files with 7 additions and 5 deletions

View file

@ -65,11 +65,13 @@ public class PonyArmourModel<T extends LivingEntity> extends AbstractPonyModel<T
} }
@Override @Override
public void synchroniseLegs(IModel model) { public void synchroniseAngles(IModel model) {
if (model instanceof BipedEntityModel) { if (model instanceof BipedEntityModel) {
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
BipedEntityModel<T> mainModel = (BipedEntityModel<T>)model; BipedEntityModel<T> mainModel = (BipedEntityModel<T>)model;
head.copyPositionAndRotation(mainModel.head);
helmet.copyPositionAndRotation(mainModel.helmet);
torso.copyPositionAndRotation(mainModel.torso); torso.copyPositionAndRotation(mainModel.torso);
rightArm.copyPositionAndRotation(mainModel.rightArm); rightArm.copyPositionAndRotation(mainModel.rightArm);
leftArm.copyPositionAndRotation(mainModel.leftArm); leftArm.copyPositionAndRotation(mainModel.leftArm);

View file

@ -56,7 +56,7 @@ public class ArmourFeature<T extends LivingEntity, M extends EntityModel<T> & IP
if (armour.prepareToRender(armorSlot, layer)) { if (armour.prepareToRender(armorSlot, layer)) {
pony.getBody().copyAttributes(armour); pony.getBody().copyAttributes(armour);
armour.setAngles(entity, limbAngle, limbDistance, age, headYaw, headPitch); armour.setAngles(entity, limbAngle, limbDistance, age, headYaw, headPitch);
armour.synchroniseLegs(pony.getBody()); armour.synchroniseAngles(pony.getBody());
IArmourTextureResolver<T> resolver = armour instanceof IArmourTextureResolver ? (IArmourTextureResolver<T>)armour : (IArmourTextureResolver<T>)DEFAULT; IArmourTextureResolver<T> resolver = armour instanceof IArmourTextureResolver ? (IArmourTextureResolver<T>)armour : (IArmourTextureResolver<T>)DEFAULT;

View file

@ -6,11 +6,11 @@ import com.minelittlepony.model.IModel;
public interface IArmour { public interface IArmour {
/** /**
* Called to synchronise this model's legs with that of another. * Called to synchronise this armour's angles with that of another.
* *
* @param model The other model to mimic * @param model The other model to mimic
*/ */
void synchroniseLegs(IModel model); void synchroniseAngles(IModel model);
/** /**
* Resets the state of this model to all invisible. * Resets the state of this model to all invisible.