mirror of
https://github.com/MineLittlePony/MineLittlePony.git
synced 2025-02-13 08:14:23 +01:00
Fixed piglin helmets not aligning with their heads
This commit is contained in:
parent
8692c124c0
commit
0d18697a67
3 changed files with 7 additions and 5 deletions
|
@ -65,11 +65,13 @@ public class PonyArmourModel<T extends LivingEntity> extends AbstractPonyModel<T
|
|||
}
|
||||
|
||||
@Override
|
||||
public void synchroniseLegs(IModel model) {
|
||||
|
||||
public void synchroniseAngles(IModel model) {
|
||||
if (model instanceof BipedEntityModel) {
|
||||
@SuppressWarnings("unchecked")
|
||||
BipedEntityModel<T> mainModel = (BipedEntityModel<T>)model;
|
||||
head.copyPositionAndRotation(mainModel.head);
|
||||
helmet.copyPositionAndRotation(mainModel.helmet);
|
||||
|
||||
torso.copyPositionAndRotation(mainModel.torso);
|
||||
rightArm.copyPositionAndRotation(mainModel.rightArm);
|
||||
leftArm.copyPositionAndRotation(mainModel.leftArm);
|
||||
|
|
|
@ -56,7 +56,7 @@ public class ArmourFeature<T extends LivingEntity, M extends EntityModel<T> & IP
|
|||
if (armour.prepareToRender(armorSlot, layer)) {
|
||||
pony.getBody().copyAttributes(armour);
|
||||
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;
|
||||
|
||||
|
|
|
@ -6,11 +6,11 @@ import com.minelittlepony.model.IModel;
|
|||
|
||||
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
|
||||
*/
|
||||
void synchroniseLegs(IModel model);
|
||||
void synchroniseAngles(IModel model);
|
||||
|
||||
/**
|
||||
* Resets the state of this model to all invisible.
|
||||
|
|
Loading…
Reference in a new issue