From a585435aa0ab622981c247967daf722d8d3d6b36 Mon Sep 17 00:00:00 2001 From: Sollace Date: Wed, 9 Aug 2023 17:54:13 +0100 Subject: [PATCH] Fixed passengers' arms swinging whilst being carried --- .../unicopia/client/minelittlepony/HeldEntityGear.java | 7 ------- .../unicopia/client/render/HeldEntityFeatureRenderer.java | 4 +++- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/src/main/java/com/minelittlepony/unicopia/client/minelittlepony/HeldEntityGear.java b/src/main/java/com/minelittlepony/unicopia/client/minelittlepony/HeldEntityGear.java index 68fb5d01..d0341d79 100644 --- a/src/main/java/com/minelittlepony/unicopia/client/minelittlepony/HeldEntityGear.java +++ b/src/main/java/com/minelittlepony/unicopia/client/minelittlepony/HeldEntityGear.java @@ -7,7 +7,6 @@ import com.minelittlepony.api.model.IModel; import com.minelittlepony.api.model.gear.IGear; import com.minelittlepony.client.model.IPonyModel; import com.minelittlepony.unicopia.client.render.HeldEntityFeatureRenderer; -import com.minelittlepony.unicopia.entity.Living; import net.minecraft.client.MinecraftClient; import net.minecraft.client.render.VertexConsumer; @@ -16,7 +15,6 @@ import net.minecraft.client.util.math.MatrixStack; import net.minecraft.entity.Entity; import net.minecraft.entity.LivingEntity; import net.minecraft.util.Identifier; -import net.minecraft.util.math.Vec3d; class HeldEntityGear extends HeldEntityFeatureRenderer implements IGear { @@ -61,9 +59,4 @@ class HeldEntityGear extends HeldEntityFeatureRenderer implements MinecraftClient.getInstance().getTickDelta(), 0, 0, 0 ); } - - @Override - protected Vec3d getCarryPosition(Living entity, Living passenger) { - return super.getCarryPosition(entity, passenger); - } } diff --git a/src/main/java/com/minelittlepony/unicopia/client/render/HeldEntityFeatureRenderer.java b/src/main/java/com/minelittlepony/unicopia/client/render/HeldEntityFeatureRenderer.java index 0eb56ee9..2ea66898 100644 --- a/src/main/java/com/minelittlepony/unicopia/client/render/HeldEntityFeatureRenderer.java +++ b/src/main/java/com/minelittlepony/unicopia/client/render/HeldEntityFeatureRenderer.java @@ -6,6 +6,7 @@ import com.minelittlepony.unicopia.entity.Living; import com.minelittlepony.unicopia.entity.duck.EntityDuck; import com.minelittlepony.unicopia.entity.duck.LivingEntityDuck; import com.minelittlepony.unicopia.entity.player.Pony; +import com.minelittlepony.unicopia.util.LimbAnimationUtil; import net.minecraft.client.MinecraftClient; import net.minecraft.client.model.ModelPart; @@ -79,6 +80,7 @@ public class HeldEntityFeatureRenderer implements Access } private void renderCarriedEntity(LivingEntity p, MatrixStack matrices, VertexConsumerProvider vertexConsumers, int light, float tickDelta) { + LimbAnimationUtil.resetToZero(p.limbAnimator); Entity vehicle = p.getVehicle(); ((EntityDuck)p).setVehicle(null); @@ -109,7 +111,7 @@ public class HeldEntityFeatureRenderer implements Access ((EntityDuck)p).setVehicle(vehicle); } - protected Vec3d getCarryPosition(Living entity, Living passenger) { + public static Vec3d getCarryPosition(Living entity, Living passenger) { float passengerHeight = MineLPDelegate.getInstance().getPonyHeight(passenger.asEntity()) / 2F; float carrierHeight = MineLPDelegate.getInstance().getPonyHeight(entity.asEntity()) / 5F;