mirror of
https://github.com/MineLittlePony/MineLittlePony.git
synced 2025-04-01 01:05:27 +02:00
Fixed head positioning on Drowned
This commit is contained in:
parent
107aedb479
commit
5066c7ad64
4 changed files with 20 additions and 11 deletions
|
@ -86,7 +86,7 @@ public abstract class AbstractPonyModel<T extends LivingEntity> extends ClientPo
|
||||||
animateBreathing(ticks);
|
animateBreathing(ticks);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (attributes.isSwimming) {
|
if (attributes.isSwimmingRotated) {
|
||||||
head.setRotationPoint(0, -2, -2);
|
head.setRotationPoint(0, -2, -2);
|
||||||
} else {
|
} else {
|
||||||
head.setRotationPoint(0, 0, 0);
|
head.setRotationPoint(0, 0, 0);
|
||||||
|
@ -213,7 +213,7 @@ public abstract class AbstractPonyModel<T extends LivingEntity> extends ClientPo
|
||||||
|
|
||||||
headPitch = attributes.isSleeping ? 0.1f : headPitch / 57.29578F;
|
headPitch = attributes.isSleeping ? 0.1f : headPitch / 57.29578F;
|
||||||
|
|
||||||
if (attributes.isSwimming) {
|
if (attributes.isSwimming && attributes.motionPitch != 0) {
|
||||||
headPitch -= 0.9F;
|
headPitch -= 0.9F;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -765,7 +765,7 @@ public abstract class AbstractPonyModel<T extends LivingEntity> extends ClientPo
|
||||||
}
|
}
|
||||||
|
|
||||||
if (part == BodyPart.HEAD) {
|
if (part == BodyPart.HEAD) {
|
||||||
rotatef(attributes.motionPitch, 1, 0, 0);
|
rotatef(attributes.motionPitch, 1, 0, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
PonyTransformation.forSize(getSize()).transform(this, part);
|
PonyTransformation.forSize(getSize()).transform(this, part);
|
||||||
|
|
|
@ -67,6 +67,8 @@ public abstract class RenderPonyMob<T extends MobEntity, M extends EntityModel<T
|
||||||
protected void setupTransforms(T entity, float ageInTicks, float rotationYaw, float partialTicks) {
|
protected void setupTransforms(T entity, float ageInTicks, float rotationYaw, float partialTicks) {
|
||||||
rotationYaw = renderPony.getRenderYaw(entity, rotationYaw, partialTicks);
|
rotationYaw = renderPony.getRenderYaw(entity, rotationYaw, partialTicks);
|
||||||
super.setupTransforms(entity, ageInTicks, rotationYaw, partialTicks);
|
super.setupTransforms(entity, ageInTicks, rotationYaw, partialTicks);
|
||||||
|
|
||||||
|
renderPony.applyPostureTransform(entity, rotationYaw, partialTicks);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -26,7 +26,7 @@ public enum PonyTransformation {
|
||||||
break;
|
break;
|
||||||
case HEAD:
|
case HEAD:
|
||||||
if (model.getAttributes().isCrouching) translate(0, 0.1F, 0);
|
if (model.getAttributes().isCrouching) translate(0, 0.1F, 0);
|
||||||
if (model.getAttributes().isSwimming) translate(0, 0.37F, 0.45F);
|
if (model.getAttributes().isSwimmingRotated) translate(0, 0.37F, 0.45F);
|
||||||
break;
|
break;
|
||||||
case BACK:
|
case BACK:
|
||||||
translateVec(riderOffset);
|
translateVec(riderOffset);
|
||||||
|
@ -47,13 +47,13 @@ public enum PonyTransformation {
|
||||||
case NECK:
|
case NECK:
|
||||||
translate(0, -0.15F, -0.07F);
|
translate(0, -0.15F, -0.07F);
|
||||||
if (model.getAttributes().isCrouching) translate(-0.03F, 0.16F, 0.07F);
|
if (model.getAttributes().isCrouching) translate(-0.03F, 0.16F, 0.07F);
|
||||||
if (model.getAttributes().isSwimming) translate(0, 0.5F, 0.25F);
|
if (model.getAttributes().isSwimmingRotated) translate(0, 0.5F, 0.25F);
|
||||||
break;
|
break;
|
||||||
case HEAD:
|
case HEAD:
|
||||||
translate(0, -0.17F, -0.04F);
|
translate(0, -0.17F, -0.04F);
|
||||||
if (model.getAttributes().isSleeping) translate(0, 0, -0.1F);
|
if (model.getAttributes().isSleeping) translate(0, 0, -0.1F);
|
||||||
if (model.getAttributes().isCrouching) translate(0, 0.15F, 0);
|
if (model.getAttributes().isCrouching) translate(0, 0.15F, 0);
|
||||||
if (model.getAttributes().isSwimming) translate(0, 0.45F, 0.45F);
|
if (model.getAttributes().isSwimmingRotated) translate(0, 0.45F, 0.45F);
|
||||||
break;
|
break;
|
||||||
case BODY:
|
case BODY:
|
||||||
translate(0, -0.2F, -0.04F);
|
translate(0, -0.2F, -0.04F);
|
||||||
|
@ -83,13 +83,13 @@ public enum PonyTransformation {
|
||||||
case NECK:
|
case NECK:
|
||||||
translate(0, -0.15F, -0.07F);
|
translate(0, -0.15F, -0.07F);
|
||||||
if (model.getAttributes().isCrouching) translate(-0.03F, 0.16F, 0.07F);
|
if (model.getAttributes().isCrouching) translate(-0.03F, 0.16F, 0.07F);
|
||||||
if (model.getAttributes().isSwimming) translate(0, 0.5F, 0.25F);
|
if (model.getAttributes().isSwimmingRotated) translate(0, 0.5F, 0.25F);
|
||||||
break;
|
break;
|
||||||
case HEAD:
|
case HEAD:
|
||||||
translate(0, -0.17F, -0.04F);
|
translate(0, -0.17F, -0.04F);
|
||||||
if (model.getAttributes().isSleeping) translate(0, 0, -0.1F);
|
if (model.getAttributes().isSleeping) translate(0, 0, -0.1F);
|
||||||
if (model.getAttributes().isCrouching) translate(0, 0.15F, 0);
|
if (model.getAttributes().isCrouching) translate(0, 0.15F, 0);
|
||||||
if (model.getAttributes().isSwimming) translate(0, 0.15F, 0.25F);
|
if (model.getAttributes().isSwimmingRotated) translate(0, 0.15F, 0.25F);
|
||||||
break;
|
break;
|
||||||
case BODY:
|
case BODY:
|
||||||
translate(0, -0.2F, -0.04F);
|
translate(0, -0.2F, -0.04F);
|
||||||
|
@ -125,7 +125,7 @@ public enum PonyTransformation {
|
||||||
if (model.getAttributes().isCrouching) translate(0, -0.01F, 0.15F);
|
if (model.getAttributes().isCrouching) translate(0, -0.01F, 0.15F);
|
||||||
break;
|
break;
|
||||||
case HEAD:
|
case HEAD:
|
||||||
if (model.getAttributes().isSwimming) translate(0, 0.9F, 0.9F);
|
if (model.getAttributes().isSwimmingRotated) translate(0, 0.9F, 0.9F);
|
||||||
scale(1.3F, 1.3F, 1.3F);
|
scale(1.3F, 1.3F, 1.3F);
|
||||||
break;
|
break;
|
||||||
case LEGS:
|
case LEGS:
|
||||||
|
@ -155,7 +155,7 @@ public enum PonyTransformation {
|
||||||
case HEAD:
|
case HEAD:
|
||||||
translate(0.01F, -0.15F, 0);
|
translate(0.01F, -0.15F, 0);
|
||||||
if (model.getAttributes().isCrouching) translate(0, 0.04F, 0);
|
if (model.getAttributes().isCrouching) translate(0, 0.04F, 0);
|
||||||
if (model.getAttributes().isSwimming) translate(0, 0.17F, 0.25F);
|
if (model.getAttributes().isSwimmingRotated) translate(0, 0.17F, 0.25F);
|
||||||
break;
|
break;
|
||||||
case BODY:
|
case BODY:
|
||||||
case TAIL:
|
case TAIL:
|
||||||
|
@ -190,7 +190,7 @@ public enum PonyTransformation {
|
||||||
case HEAD:
|
case HEAD:
|
||||||
translate(0, -0.15F, 0.01F);
|
translate(0, -0.15F, 0.01F);
|
||||||
if (model.getAttributes().isCrouching) translate(0, 0.04F, 0);
|
if (model.getAttributes().isCrouching) translate(0, 0.04F, 0);
|
||||||
if (model.getAttributes().isSwimming) translate(0, 0.8F, 0.85F);
|
if (model.getAttributes().isSwimmingRotated) translate(0, 0.8F, 0.85F);
|
||||||
scale(1.15F, 1.15F, 1.15F);
|
scale(1.15F, 1.15F, 1.15F);
|
||||||
break;
|
break;
|
||||||
case BODY:
|
case BODY:
|
||||||
|
|
|
@ -3,6 +3,7 @@ package com.minelittlepony.model;
|
||||||
import com.minelittlepony.pony.IPony;
|
import com.minelittlepony.pony.IPony;
|
||||||
import com.minelittlepony.util.math.MathUtil;
|
import com.minelittlepony.util.math.MathUtil;
|
||||||
import net.minecraft.entity.LivingEntity;
|
import net.minecraft.entity.LivingEntity;
|
||||||
|
import net.minecraft.entity.player.PlayerEntity;
|
||||||
import net.minecraft.util.Arm;
|
import net.minecraft.util.Arm;
|
||||||
import net.minecraft.util.math.Vec3d;
|
import net.minecraft.util.math.Vec3d;
|
||||||
|
|
||||||
|
@ -27,6 +28,11 @@ public class ModelAttributes<T extends LivingEntity> {
|
||||||
* True if the model is swimming under water.
|
* True if the model is swimming under water.
|
||||||
*/
|
*/
|
||||||
public boolean isSwimming;
|
public boolean isSwimming;
|
||||||
|
/**
|
||||||
|
* True if the model is swimming, and rotated 90degs (players)
|
||||||
|
*/
|
||||||
|
public boolean isSwimmingRotated;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* True if the pony is crouching.
|
* True if the pony is crouching.
|
||||||
*/
|
*/
|
||||||
|
@ -96,6 +102,7 @@ public class ModelAttributes<T extends LivingEntity> {
|
||||||
isFlying = pony.isFlying(entity);
|
isFlying = pony.isFlying(entity);
|
||||||
isGliding = entity.isFallFlying();
|
isGliding = entity.isFallFlying();
|
||||||
isSwimming = pony.isSwimming(entity);
|
isSwimming = pony.isSwimming(entity);
|
||||||
|
isSwimmingRotated = isSwimming && entity instanceof PlayerEntity;
|
||||||
hasHeadGear = pony.isWearingHeadgear(entity);
|
hasHeadGear = pony.isWearingHeadgear(entity);
|
||||||
isSitting = pony.isRidingInteractive(entity);
|
isSitting = pony.isRidingInteractive(entity);
|
||||||
interpolatorId = entity.getUuid();
|
interpolatorId = entity.getUuid();
|
||||||
|
|
Loading…
Add table
Reference in a new issue