mirror of
https://github.com/MineLittlePony/MineLittlePony.git
synced 2024-11-28 23:17:59 +01:00
Fixed incorrect riding position
This commit is contained in:
parent
627adab1f6
commit
e45c237e82
3 changed files with 3 additions and 5 deletions
|
@ -31,7 +31,7 @@ public class PonyBounds {
|
||||||
float delta = MinecraftClient.getInstance().getTickDelta();
|
float delta = MinecraftClient.getInstance().getTickDelta();
|
||||||
|
|
||||||
Entity vehicle = entity.getVehicle();
|
Entity vehicle = entity.getVehicle();
|
||||||
double vehicleOffset = vehicle == null ? 0 : vehicle.getHeight() - entity.getRidingOffset(vehicle);
|
double vehicleOffset = vehicle == null ? 0 : vehicle.getHeight();
|
||||||
|
|
||||||
return new Vec3d(
|
return new Vec3d(
|
||||||
MathHelper.lerp(delta, entity.prevX, entity.getX()),
|
MathHelper.lerp(delta, entity.prevX, entity.getX()),
|
||||||
|
|
|
@ -55,10 +55,8 @@ abstract class MixinClientPlayerEntity extends AbstractClientPlayerEntity implem
|
||||||
value *= factor;
|
value *= factor;
|
||||||
|
|
||||||
if (hasVehicle()) {
|
if (hasVehicle()) {
|
||||||
value += getVehicle().getEyeHeight(getVehicle().getPose());
|
value += getVehicle().getHeight();
|
||||||
value -= getRidingOffset(getVehicle());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return Math.max(value, 0.1F);
|
return Math.max(value, 0.1F);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -99,7 +99,7 @@ public abstract class AbstractPonyRenderer<T extends MobEntity, M extends Entity
|
||||||
if (!entity.hasVehicle()) {
|
if (!entity.hasVehicle()) {
|
||||||
stack.translate(0, 0, -entity.getWidth() / 2); // move us to the center of the shadow
|
stack.translate(0, 0, -entity.getWidth() / 2); // move us to the center of the shadow
|
||||||
} else {
|
} else {
|
||||||
stack.translate(0, entity.getRidingOffset(entity.getVehicle()), 0);
|
stack.translate(0, -entity.getRidingOffset(entity.getVehicle()), 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
stack.scale(scale, scale, scale);
|
stack.scale(scale, scale, scale);
|
||||||
|
|
Loading…
Reference in a new issue