mirror of
https://github.com/MineLittlePony/MineLittlePony.git
synced 2024-11-22 04:27:59 +01:00
Ponies can now lie down by holding crouch and not moving
This commit is contained in:
parent
9f77999baf
commit
060c4abfff
2 changed files with 11 additions and 0 deletions
|
@ -10,6 +10,7 @@ import java.util.*;
|
||||||
|
|
||||||
import net.minecraft.client.render.entity.model.BipedEntityModel.ArmPose;
|
import net.minecraft.client.render.entity.model.BipedEntityModel.ArmPose;
|
||||||
import net.minecraft.entity.LivingEntity;
|
import net.minecraft.entity.LivingEntity;
|
||||||
|
import net.minecraft.entity.player.PlayerEntity;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.util.*;
|
import net.minecraft.util.*;
|
||||||
import net.minecraft.util.math.MathHelper;
|
import net.minecraft.util.math.MathHelper;
|
||||||
|
@ -152,6 +153,11 @@ public class ModelAttributes {
|
||||||
isSitting = PonyPosture.isSitting(entity);
|
isSitting = PonyPosture.isSitting(entity);
|
||||||
isSleeping = entity.isAlive() && entity.isSleeping();;
|
isSleeping = entity.isAlive() && entity.isSleeping();;
|
||||||
isLyingDown = isSleeping;
|
isLyingDown = isSleeping;
|
||||||
|
if (entity instanceof PlayerEntity) {
|
||||||
|
boolean moving = entity.getVelocity().multiply(1, 0, 1).length() == 0 && entity.isSneaking();
|
||||||
|
isLyingDown |= getMainInterpolator().interpolate("lyingDown", moving ? 10 : 0, 10) >= 9;
|
||||||
|
}
|
||||||
|
|
||||||
isCrouching = !isLyingDown && !isSitting && mode == Mode.THIRD_PERSON && PonyPosture.isCrouching(pony, entity);
|
isCrouching = !isLyingDown && !isSitting && mode == Mode.THIRD_PERSON && PonyPosture.isCrouching(pony, entity);
|
||||||
isFlying = !isLyingDown && mode == Mode.THIRD_PERSON && PonyPosture.isFlying(entity);
|
isFlying = !isLyingDown && mode == Mode.THIRD_PERSON && PonyPosture.isFlying(entity);
|
||||||
isGliding = entity.isFallFlying();
|
isGliding = entity.isFallFlying();
|
||||||
|
|
|
@ -623,8 +623,11 @@ public abstract class AbstractPonyModel<T extends LivingEntity> extends ClientPo
|
||||||
stack.multiply(RotationAxis.POSITIVE_Y.rotationDegrees(180));
|
stack.multiply(RotationAxis.POSITIVE_Y.rotationDegrees(180));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
boolean crouching = attributes.isCrouching;
|
||||||
|
|
||||||
if (attributes.isLyingDown && !attributes.isSleeping) {
|
if (attributes.isLyingDown && !attributes.isSleeping) {
|
||||||
stack.translate(0, 1.35F, 0);
|
stack.translate(0, 1.35F, 0);
|
||||||
|
attributes.isCrouching = sneaking;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (attributes.isHorsey) {
|
if (attributes.isHorsey) {
|
||||||
|
@ -638,5 +641,7 @@ public abstract class AbstractPonyModel<T extends LivingEntity> extends ClientPo
|
||||||
}
|
}
|
||||||
|
|
||||||
PonyTransformation.forSize(getSize()).transform(this, part, stack);
|
PonyTransformation.forSize(getSize()).transform(this, part, stack);
|
||||||
|
|
||||||
|
attributes.isCrouching = crouching;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue