Fixed incorrect riding position

This commit is contained in:
Sollace 2023-09-25 01:41:43 +01:00
parent 627adab1f6
commit e45c237e82
No known key found for this signature in database
GPG key ID: E52FACE7B5C773DB
3 changed files with 3 additions and 5 deletions

View file

@ -31,7 +31,7 @@ public class PonyBounds {
float delta = MinecraftClient.getInstance().getTickDelta();
Entity vehicle = entity.getVehicle();
double vehicleOffset = vehicle == null ? 0 : vehicle.getHeight() - entity.getRidingOffset(vehicle);
double vehicleOffset = vehicle == null ? 0 : vehicle.getHeight();
return new Vec3d(
MathHelper.lerp(delta, entity.prevX, entity.getX()),

View file

@ -55,10 +55,8 @@ abstract class MixinClientPlayerEntity extends AbstractClientPlayerEntity implem
value *= factor;
if (hasVehicle()) {
value += getVehicle().getEyeHeight(getVehicle().getPose());
value -= getRidingOffset(getVehicle());
value += getVehicle().getHeight();
}
return Math.max(value, 0.1F);
}
}

View file

@ -99,7 +99,7 @@ public abstract class AbstractPonyRenderer<T extends MobEntity, M extends Entity
if (!entity.hasVehicle()) {
stack.translate(0, 0, -entity.getWidth() / 2); // move us to the center of the shadow
} else {
stack.translate(0, entity.getRidingOffset(entity.getVehicle()), 0);
stack.translate(0, -entity.getRidingOffset(entity.getVehicle()), 0);
}
stack.scale(scale, scale, scale);