mirror of
https://github.com/MineLittlePony/MineLittlePony.git
synced 2024-11-27 06:47:59 +01:00
(reported by Poly) Fix head position and vertical alignment issues when sneaking
This commit is contained in:
parent
20cec41037
commit
d5efe0d3f6
3 changed files with 15 additions and 6 deletions
|
@ -108,6 +108,10 @@ public class RenderPlayerModel<M extends EntityPlayerModel> extends RenderLiving
|
||||||
|
|
||||||
double offset = entity.getYOffset() + entity.posY + 0.01;
|
double offset = entity.getYOffset() + entity.posY + 0.01;
|
||||||
|
|
||||||
|
if (entity.isSneaking()) {
|
||||||
|
y -= 0.125D;
|
||||||
|
}
|
||||||
|
|
||||||
pushMatrix();
|
pushMatrix();
|
||||||
enableBlend();
|
enableBlend();
|
||||||
color(1, 1, 1, 0.3F);
|
color(1, 1, 1, 0.3F);
|
||||||
|
|
|
@ -717,7 +717,7 @@ public abstract class AbstractPonyModel extends ModelPlayer implements IModel {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isChild() {
|
public boolean isChild() {
|
||||||
return metadata.getSize() == PonySize.FOAL || isChild;
|
return getSize() == PonySize.FOAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -737,7 +737,7 @@ public abstract class AbstractPonyModel extends ModelPlayer implements IModel {
|
||||||
return 0.25F;
|
return 0.25F;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (getMetadata().getSize()) {
|
switch (getSize()) {
|
||||||
case NORMAL: return 0.4F;
|
case NORMAL: return 0.4F;
|
||||||
case FOAL:
|
case FOAL:
|
||||||
case TALL:
|
case TALL:
|
||||||
|
@ -834,7 +834,7 @@ public abstract class AbstractPonyModel extends ModelPlayer implements IModel {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void transform(BodyPart part) {
|
public void transform(BodyPart part) {
|
||||||
if (isRiding) translate(0, -0.4F, -0.2F);
|
if (isRiding()) translate(0, -0.4F, -0.2F);
|
||||||
|
|
||||||
if (isSleeping) {
|
if (isSleeping) {
|
||||||
rotate(90, 1, 0, 0);
|
rotate(90, 1, 0, 0);
|
||||||
|
|
|
@ -11,11 +11,16 @@ public enum PonyTransformation {
|
||||||
NORMAL {
|
NORMAL {
|
||||||
@Override
|
@Override
|
||||||
public void transform(IModel model, BodyPart part) {
|
public void transform(IModel model, BodyPart part) {
|
||||||
|
if (model.isCrouching()) translate(0, -0.2F, 0);
|
||||||
if (model.isSleeping()) translate(0, -0.61F, 0);
|
if (model.isSleeping()) translate(0, -0.61F, 0);
|
||||||
|
|
||||||
switch (part) {
|
switch (part) {
|
||||||
case NECK:
|
case NECK:
|
||||||
if (model.isCrouching()) translate(-0.03F, 0.03F, 0.1F);
|
if (model.isCrouching()) translate(-0.03F, 0.03F, 0.1F);
|
||||||
|
break;
|
||||||
|
case HEAD:
|
||||||
|
if (model.isCrouching()) translate(0, 0.1F, 0);
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -23,6 +28,7 @@ public enum PonyTransformation {
|
||||||
LARGE {
|
LARGE {
|
||||||
@Override
|
@Override
|
||||||
public void transform(IModel model, BodyPart part) {
|
public void transform(IModel model, BodyPart part) {
|
||||||
|
if (model.isCrouching()) translate(0, -0.15F, 0);
|
||||||
if (model.isSleeping()) translate(0, -0.98F, 0.2F);
|
if (model.isSleeping()) translate(0, -0.98F, 0.2F);
|
||||||
|
|
||||||
switch (part) {
|
switch (part) {
|
||||||
|
@ -77,6 +83,7 @@ public enum PonyTransformation {
|
||||||
TALL {
|
TALL {
|
||||||
@Override
|
@Override
|
||||||
public void transform(IModel model, BodyPart part) {
|
public void transform(IModel model, BodyPart part) {
|
||||||
|
if (model.isCrouching()) translate(0, -0.15F, 0);
|
||||||
if (model.isSleeping()) translate(0, -0.5F, 0.25F);
|
if (model.isSleeping()) translate(0, -0.5F, 0.25F);
|
||||||
|
|
||||||
switch (part) {
|
switch (part) {
|
||||||
|
@ -87,11 +94,9 @@ public enum PonyTransformation {
|
||||||
break;
|
break;
|
||||||
case HEAD:
|
case HEAD:
|
||||||
translate(0, -0.15F, 0.01F);
|
translate(0, -0.15F, 0.01F);
|
||||||
if (model.isCrouching()) translate(0, 0.05F, 0);
|
if (model.isCrouching()) translate(0, 0.04F, 0);
|
||||||
break;
|
break;
|
||||||
case BODY:
|
case BODY:
|
||||||
translate(0, -0.1F, 0);
|
|
||||||
break;
|
|
||||||
case TAIL:
|
case TAIL:
|
||||||
translate(0, -0.1F, 0);
|
translate(0, -0.1F, 0);
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in a new issue