Fix various transformations for when a pony is lying down but not sleeping

This commit is contained in:
Sollace 2024-02-09 19:25:23 +00:00
parent f5bfa14bb1
commit 7da44b879c
No known key found for this signature in database
GPG key ID: E52FACE7B5C773DB
3 changed files with 20 additions and 10 deletions

View file

@ -51,7 +51,7 @@ public abstract class ClientPonyModel<T extends LivingEntity> extends MsonPlayer
child = entity.isBaby(); child = entity.isBaby();
attributes.updateLivingState(entity, pony, mode); attributes.updateLivingState(entity, pony, mode);
PonyModelPrepareCallback.EVENT.invoker().onPonyModelPrepared(entity, this, mode); PonyModelPrepareCallback.EVENT.invoker().onPonyModelPrepared(entity, this, mode);
sneaking = attributes.isCrouching; sneaking = attributes.isCrouching && !attributes.isLyingDown;
riding = attributes.isSitting; riding = attributes.isSitting;
} }

View file

@ -31,8 +31,11 @@ public class CapeFeature<M extends ClientPonyModel<AbstractClientPlayerEntity>>
stack.push(); stack.push();
model.transform(BodyPart.BODY, stack);
stack.translate(0, 0.24F, 0); stack.translate(0, 0.24F, 0);
if (model.getAttributes().isLyingDown) {
stack.translate(0, -0.05F, 0);
}
model.transform(BodyPart.BODY, stack);
model.getBodyPart(BodyPart.BODY).rotate(stack); model.getBodyPart(BodyPart.BODY).rotate(stack);
double capeX = MathHelper.lerp(tickDelta, player.capeX, player.prevCapeX) - MathHelper.lerp(tickDelta, player.prevX, player.getX()); double capeX = MathHelper.lerp(tickDelta, player.capeX, player.prevCapeX) - MathHelper.lerp(tickDelta, player.prevX, player.getX());

View file

@ -20,7 +20,8 @@ public enum PonyTransformation {
public void transform(PonyModel<?> model, BodyPart part, MatrixStack stack) { public void transform(PonyModel<?> model, BodyPart part, MatrixStack stack) {
if (model.getAttributes().isSwimming) stack.translate(0, -0.3F, 0); if (model.getAttributes().isSwimming) stack.translate(0, -0.3F, 0);
if (model.getAttributes().isCrouching) stack.translate(0, -0.2F, 0); if (model.getAttributes().isCrouching) stack.translate(0, -0.2F, 0);
if (model.getAttributes().isLyingDown) stack.translate(0, -0.61F, 0.1F); if (model.getAttributes().isLyingDown) stack.translate(0, -0.77F, 0.1F);
if (model.getAttributes().isSleeping) stack.translate(0, 0.16F, 0);
if (model.getAttributes().isSitting) stack.translate(0, -0.2F, -0.2F); if (model.getAttributes().isSitting) stack.translate(0, -0.2F, -0.2F);
switch (part) { switch (part) {
@ -28,7 +29,8 @@ public enum PonyTransformation {
if (model.getAttributes().isCrouching) stack.translate(-0.03F, 0.03F, 0.13F); if (model.getAttributes().isCrouching) stack.translate(-0.03F, 0.03F, 0.13F);
break; break;
case HEAD: case HEAD:
if (model.getAttributes().isCrouching) stack.translate(0, 0.1F, 0); if (model.getAttributes().isLyingDown) stack.translate(-0.05F, -0.05F, 0);
if (model.getAttributes().isCrouching) stack.translate(0, 0.1F, -0);
break; break;
case BACK: case BACK:
translateForRider(stack); translateForRider(stack);
@ -42,7 +44,8 @@ public enum PonyTransformation {
public void transform(PonyModel<?> model, BodyPart part, MatrixStack stack) { public void transform(PonyModel<?> model, BodyPart part, MatrixStack stack) {
if (model.getAttributes().isSwimming) stack.translate(0, -0.2F, 0); if (model.getAttributes().isSwimming) stack.translate(0, -0.2F, 0);
if (model.getAttributes().isCrouching) stack.translate(0, -0.15F, 0); if (model.getAttributes().isCrouching) stack.translate(0, -0.15F, 0);
if (model.getAttributes().isLyingDown) stack.translate(0, -0.6F, 0.15F); if (model.getAttributes().isLyingDown) stack.translate(0, -0.68F, 0.15F);
if (model.getAttributes().isSleeping) stack.translate(0, 0.08F, 0);
if (model.getAttributes().isSitting) stack.translate(0, 0, -0.2F); if (model.getAttributes().isSitting) stack.translate(0, 0, -0.2F);
switch (part) { switch (part) {
@ -77,7 +80,8 @@ public enum PonyTransformation {
@Override @Override
public void transform(PonyModel<?> model, BodyPart part, MatrixStack stack) { public void transform(PonyModel<?> model, BodyPart part, MatrixStack stack) {
if (model.getAttributes().isCrouching) stack.translate(0, -0.15F, 0); if (model.getAttributes().isCrouching) stack.translate(0, -0.15F, 0);
if (model.getAttributes().isLyingDown) stack.translate(0, -0.6F, 0.25F); if (model.getAttributes().isLyingDown) stack.translate(0, -0.66F, 0.25F);
if (model.getAttributes().isSleeping) stack.translate(0, 0.06F, 0);
if (model.getAttributes().isSitting) stack.translate(0, 0, -0.2F); if (model.getAttributes().isSitting) stack.translate(0, 0, -0.2F);
switch (part) { switch (part) {
@ -88,7 +92,7 @@ public enum PonyTransformation {
break; break;
case HEAD: case HEAD:
stack.translate(0, -0.14F, -0.06F); stack.translate(0, -0.14F, -0.06F);
if (model.getAttributes().isLyingDown) stack.translate(0, 0, -0.1F); if (model.getAttributes().isLyingDown) stack.translate(-0.05F, 0, -0.1F);
if (model.getAttributes().isCrouching) stack.translate(0, 0.15F, 0); if (model.getAttributes().isCrouching) stack.translate(0, 0.15F, 0);
break; break;
case BODY: case BODY:
@ -113,7 +117,8 @@ public enum PonyTransformation {
public void transform(PonyModel<?> model, BodyPart part, MatrixStack stack) { public void transform(PonyModel<?> model, BodyPart part, MatrixStack stack) {
if (model.getAttributes().isSwimming) stack.translate(0, -0.9F, 0); if (model.getAttributes().isSwimming) stack.translate(0, -0.9F, 0);
if (model.getAttributes().isCrouching) stack.translate(0, -0.2F, 0); if (model.getAttributes().isCrouching) stack.translate(0, -0.2F, 0);
if (model.getAttributes().isLyingDown) stack.translate(0, -0.8F, -0.3F); if (model.getAttributes().isLyingDown) stack.translate(0, -0.98F, -0.3F);
if (model.getAttributes().isSleeping) stack.translate(0, 0.18F, 0);
if (model.getAttributes().isSitting) stack.translate(0, -0.6F, -0.2F); if (model.getAttributes().isSitting) stack.translate(0, -0.6F, -0.2F);
stack.translate(0, 0.2F, 0); stack.translate(0, 0.2F, 0);
@ -142,7 +147,8 @@ public enum PonyTransformation {
@Override @Override
public void transform(PonyModel<?> model, BodyPart part, MatrixStack stack) { public void transform(PonyModel<?> model, BodyPart part, MatrixStack stack) {
if (model.getAttributes().isCrouching) stack.translate(0, -0.15F, 0); if (model.getAttributes().isCrouching) stack.translate(0, -0.15F, 0);
if (model.getAttributes().isLyingDown) stack.translate(0, -0.5F, 0.35F); if (model.getAttributes().isLyingDown) stack.translate(0, -0.6F, 0.35F);
if (model.getAttributes().isSleeping) stack.translate(0, 0.1F, 0);
if (model.getAttributes().isSitting) stack.translate(0, 0.1F, -0.2F); if (model.getAttributes().isSitting) stack.translate(0, 0.1F, -0.2F);
switch (part) { switch (part) {
@ -175,7 +181,8 @@ public enum PonyTransformation {
public void transform(PonyModel<?> model, BodyPart part, MatrixStack stack) { public void transform(PonyModel<?> model, BodyPart part, MatrixStack stack) {
if (model.getAttributes().isSwimming) stack.translate(0, -0.6F, 0); if (model.getAttributes().isSwimming) stack.translate(0, -0.6F, 0);
if (model.getAttributes().isCrouching) stack.translate(0, -0.15F, 0); if (model.getAttributes().isCrouching) stack.translate(0, -0.15F, 0);
if (model.getAttributes().isLyingDown) stack.translate(0, -0.45F, -0.3F); if (model.getAttributes().isLyingDown) stack.translate(0, -0.71F, -0.3F);
if (model.getAttributes().isSleeping) stack.translate(0, 0.26F, 0);
if (model.getAttributes().isSitting) stack.translate(0, -0.4F, -0.2F); if (model.getAttributes().isSitting) stack.translate(0, -0.4F, -0.2F);
switch (part) { switch (part) {