mirror of
https://github.com/MineLittlePony/MineLittlePony.git
synced 2024-11-22 04:27:59 +01:00
Use the entity's height to inform a correct position for the nameplate
This commit is contained in:
parent
54451d142b
commit
75f6d6d154
7 changed files with 8 additions and 5 deletions
|
@ -21,7 +21,6 @@ public class EnderStallionModel extends SkeleponyModel<EndermanEntity> {
|
|||
|
||||
public EnderStallionModel() {
|
||||
super();
|
||||
attributes.visualHeight = 3;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -32,7 +32,6 @@ public class SkeleponyModel<T extends HostileEntity> extends AlicornModel<T> imp
|
|||
public void animateModel(T entity, float move, float swing, float ticks) {
|
||||
isUnicorn = entity.getUuid().getLeastSignificantBits() % 3 != 0;
|
||||
isWithered = entity instanceof WitherSkeletonEntity;
|
||||
attributes.visualHeight = isWithered ? 2.5F : 2;
|
||||
|
||||
rightArmPose = ArmPose.EMPTY;
|
||||
leftArmPose = ArmPose.EMPTY;
|
||||
|
|
|
@ -68,7 +68,7 @@ public class VillagerPonyModel<T extends LivingEntity & VillagerDataContainer> e
|
|||
|
||||
VillagerProfession profession = entity.getVillagerData().getProfession();
|
||||
|
||||
attributes.visualHeight = PonyTextures.isCrownPony(entity) ? 2.3F : 2;
|
||||
attributes.visualHeight += PonyTextures.isCrownPony(entity) ? 0.3F : -0.1F;
|
||||
apron.visible = !special && profession == VillagerProfession.BUTCHER;
|
||||
trinket.visible = !special && !apron.visible && profession != VillagerProfession.NONE && profession != VillagerProfession.NITWIT;
|
||||
}
|
||||
|
|
|
@ -12,7 +12,6 @@ public class WitchPonyModel extends ZebraModel<WitchEntity> {
|
|||
|
||||
public WitchPonyModel() {
|
||||
super(false);
|
||||
attributes.visualHeight = 2.5F;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -22,6 +21,7 @@ public class WitchPonyModel extends ZebraModel<WitchEntity> {
|
|||
if (entity.hasCustomName() && "Filly".equals(entity.getCustomName().getString())) {
|
||||
child = true;
|
||||
}
|
||||
attributes.visualHeight += 0.5F;
|
||||
leftArmPose = ArmPose.EMPTY;
|
||||
rightArmPose = entity.getMainHandStack().isEmpty() ? ArmPose.EMPTY : ArmPose.ITEM;
|
||||
}
|
||||
|
|
|
@ -176,7 +176,7 @@ public class EquineRenderManager<T extends LivingEntity, M extends EntityModel<T
|
|||
public double getNamePlateYOffset(T entity) {
|
||||
|
||||
// We start by negating the height calculation done by mahjong.
|
||||
float y = -(entity.getHeight() + 0.5F - (entity.isInSneakingPose() ? 0.25F : 0));
|
||||
float y = -(entity.getHeight() + 0.5F);
|
||||
|
||||
// Then we add our own offsets.
|
||||
y += getModel().getAttributes().visualHeight * getScaleFactor() + 0.25F;
|
||||
|
|
|
@ -99,6 +99,10 @@ public class PlayerPonyRenderer extends PlayerEntityRenderer implements IPonyRen
|
|||
}
|
||||
}
|
||||
|
||||
protected boolean hasLabel(AbstractClientPlayerEntity entity) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void setupTransforms(AbstractClientPlayerEntity entity, MatrixStack stack, float ageInTicks, float rotationYaw, float partialTicks) {
|
||||
manager.preRenderCallback(entity, stack, partialTicks);
|
||||
|
|
|
@ -118,6 +118,7 @@ public class ModelAttributes<T extends LivingEntity> {
|
|||
}
|
||||
|
||||
public void updateLivingState(T entity, IPony pony, EquineRenderManager.Mode mode) {
|
||||
visualHeight = entity.getHeight() + 0.125F;
|
||||
isSitting = pony.isSitting(entity);
|
||||
isCrouching = !isSitting && mode == Mode.THIRD_PERSON && pony.isCrouching(entity);
|
||||
isSleeping = entity.isSleeping();
|
||||
|
|
Loading…
Reference in a new issue