From 21a70d205a8688ecfd82ded93b6d7a0675eae942 Mon Sep 17 00:00:00 2001 From: Sollace Date: Thu, 23 Dec 2021 00:18:48 +0200 Subject: [PATCH] Fixed incorrect eye height in vehicles when filly cam is turned off --- .../client/mixin/MixinClientPlayerEntity.java | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/minelittlepony/client/mixin/MixinClientPlayerEntity.java b/src/main/java/com/minelittlepony/client/mixin/MixinClientPlayerEntity.java index dc50ae60..e213643f 100644 --- a/src/main/java/com/minelittlepony/client/mixin/MixinClientPlayerEntity.java +++ b/src/main/java/com/minelittlepony/client/mixin/MixinClientPlayerEntity.java @@ -47,14 +47,17 @@ abstract class MixinClientPlayerEntity extends AbstractClientPlayerEntity implem IPony pony = MineLittlePony.getInstance().getManager().getPony(this); if (!pony.getRace(false).isHuman()) { - value *= pony.getMetadata().getSize().getEyeHeightFactor(); + float factor = pony.getMetadata().getSize().getEyeHeightFactor(); + if (factor != 1) { + value *= factor; - if (hasVehicle()) { - value += getVehicle().getEyeHeight(getVehicle().getPose()); - value -= getVehicle().getMountedHeightOffset(); + if (hasVehicle()) { + value += getVehicle().getEyeHeight(getVehicle().getPose()); + value -= getVehicle().getMountedHeightOffset(); + } + + return Math.max(value, 0.1F); } - - return Math.max(value, 0.1F); } return value;