Fixed passengers' arms swinging whilst being carried

This commit is contained in:
Sollace 2023-08-09 17:54:13 +01:00
parent 622ffa31de
commit a585435aa0
No known key found for this signature in database
GPG key ID: E52FACE7B5C773DB
2 changed files with 3 additions and 8 deletions

View file

@ -7,7 +7,6 @@ import com.minelittlepony.api.model.IModel;
import com.minelittlepony.api.model.gear.IGear; import com.minelittlepony.api.model.gear.IGear;
import com.minelittlepony.client.model.IPonyModel; import com.minelittlepony.client.model.IPonyModel;
import com.minelittlepony.unicopia.client.render.HeldEntityFeatureRenderer; import com.minelittlepony.unicopia.client.render.HeldEntityFeatureRenderer;
import com.minelittlepony.unicopia.entity.Living;
import net.minecraft.client.MinecraftClient; import net.minecraft.client.MinecraftClient;
import net.minecraft.client.render.VertexConsumer; 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.Entity;
import net.minecraft.entity.LivingEntity; import net.minecraft.entity.LivingEntity;
import net.minecraft.util.Identifier; import net.minecraft.util.Identifier;
import net.minecraft.util.math.Vec3d;
class HeldEntityGear extends HeldEntityFeatureRenderer<LivingEntity> implements IGear { class HeldEntityGear extends HeldEntityFeatureRenderer<LivingEntity> implements IGear {
@ -61,9 +59,4 @@ class HeldEntityGear extends HeldEntityFeatureRenderer<LivingEntity> implements
MinecraftClient.getInstance().getTickDelta(), 0, 0, 0 MinecraftClient.getInstance().getTickDelta(), 0, 0, 0
); );
} }
@Override
protected Vec3d getCarryPosition(Living<LivingEntity> entity, Living<?> passenger) {
return super.getCarryPosition(entity, passenger);
}
} }

View file

@ -6,6 +6,7 @@ import com.minelittlepony.unicopia.entity.Living;
import com.minelittlepony.unicopia.entity.duck.EntityDuck; import com.minelittlepony.unicopia.entity.duck.EntityDuck;
import com.minelittlepony.unicopia.entity.duck.LivingEntityDuck; import com.minelittlepony.unicopia.entity.duck.LivingEntityDuck;
import com.minelittlepony.unicopia.entity.player.Pony; import com.minelittlepony.unicopia.entity.player.Pony;
import com.minelittlepony.unicopia.util.LimbAnimationUtil;
import net.minecraft.client.MinecraftClient; import net.minecraft.client.MinecraftClient;
import net.minecraft.client.model.ModelPart; import net.minecraft.client.model.ModelPart;
@ -79,6 +80,7 @@ public class HeldEntityFeatureRenderer<E extends LivingEntity> implements Access
} }
private void renderCarriedEntity(LivingEntity p, MatrixStack matrices, VertexConsumerProvider vertexConsumers, int light, float tickDelta) { private void renderCarriedEntity(LivingEntity p, MatrixStack matrices, VertexConsumerProvider vertexConsumers, int light, float tickDelta) {
LimbAnimationUtil.resetToZero(p.limbAnimator);
Entity vehicle = p.getVehicle(); Entity vehicle = p.getVehicle();
((EntityDuck)p).setVehicle(null); ((EntityDuck)p).setVehicle(null);
@ -109,7 +111,7 @@ public class HeldEntityFeatureRenderer<E extends LivingEntity> implements Access
((EntityDuck)p).setVehicle(vehicle); ((EntityDuck)p).setVehicle(vehicle);
} }
protected Vec3d getCarryPosition(Living<E> entity, Living<?> passenger) { public static Vec3d getCarryPosition(Living<?> entity, Living<?> passenger) {
float passengerHeight = MineLPDelegate.getInstance().getPonyHeight(passenger.asEntity()) / 2F; float passengerHeight = MineLPDelegate.getInstance().getPonyHeight(passenger.asEntity()) / 2F;
float carrierHeight = MineLPDelegate.getInstance().getPonyHeight(entity.asEntity()) / 5F; float carrierHeight = MineLPDelegate.getInstance().getPonyHeight(entity.asEntity()) / 5F;