Fix head position an vertical alignment issues when sneaking

This commit is contained in:
Sollace 2018-07-28 19:01:12 +02:00
parent b5dfd57727
commit bd010d6d97
3 changed files with 16 additions and 6 deletions

View file

@ -108,6 +108,10 @@ public class RenderPlayerModel<M extends EntityPlayerModel> extends RenderLiving
double offset = entity.getYOffset() + entity.posY + 0.01;
if (entity.isSneaking()) {
y -= 0.125D;
}
GL11.glPushAttrib(GL11.GL_ALL_ATTRIB_BITS);
pushMatrix();
@ -123,6 +127,7 @@ public class RenderPlayerModel<M extends EntityPlayerModel> extends RenderLiving
pushMatrix();
scale(1, -1, 1);
translate(0, offset, 0);
super.doRender(entity, x, y, z, entityYaw, partialTicks);

View file

@ -717,7 +717,7 @@ public abstract class AbstractPonyModel extends ModelPlayer implements IModel {
@Override
public boolean isChild() {
return metadata.getSize() == PonySize.FOAL || isChild;
return getSize() == PonySize.FOAL;
}
@Override
@ -737,7 +737,7 @@ public abstract class AbstractPonyModel extends ModelPlayer implements IModel {
return 0.25F;
}
switch (getMetadata().getSize()) {
switch (getSize()) {
case NORMAL: return 0.4F;
case FOAL:
case TALL:
@ -834,7 +834,7 @@ public abstract class AbstractPonyModel extends ModelPlayer implements IModel {
@Override
public void transform(BodyPart part) {
if (isRiding) translate(0, -0.4F, -0.2F);
if (isRiding()) translate(0, -0.4F, -0.2F);
if (isSleeping) {
rotate(90, 1, 0, 0);

View file

@ -11,11 +11,16 @@ public enum PonyTransformation {
NORMAL {
@Override
public void transform(IModel model, BodyPart part) {
if (model.isCrouching()) translate(0, -0.2F, 0);
if (model.isSleeping()) translate(0, -0.61F, 0);
switch (part) {
case NECK:
if (model.isCrouching()) translate(-0.03F, 0.03F, 0.1F);
break;
case HEAD:
if (model.isCrouching()) translate(0, 0.1F, 0);
break;
default:
}
}
@ -23,6 +28,7 @@ public enum PonyTransformation {
LARGE {
@Override
public void transform(IModel model, BodyPart part) {
if (model.isCrouching()) translate(0, -0.15F, 0);
if (model.isSleeping()) translate(0, -0.98F, 0.2F);
switch (part) {
@ -77,6 +83,7 @@ public enum PonyTransformation {
TALL {
@Override
public void transform(IModel model, BodyPart part) {
if (model.isCrouching()) translate(0, -0.15F, 0);
if (model.isSleeping()) translate(0, -0.5F, 0.25F);
switch (part) {
@ -87,11 +94,9 @@ public enum PonyTransformation {
break;
case HEAD:
translate(0, -0.15F, 0.01F);
if (model.isCrouching()) translate(0, 0.05F, 0);
if (model.isCrouching()) translate(0, 0.04F, 0);
break;
case BODY:
translate(0, -0.1F, 0);
break;
case TAIL:
translate(0, -0.1F, 0);
break;