mirror of
https://github.com/MineLittlePony/MineLittlePony.git
synced 2024-11-26 22:38:00 +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;
|
||||
|
||||
if (entity.isSneaking()) {
|
||||
y -= 0.125D;
|
||||
}
|
||||
|
||||
pushMatrix();
|
||||
enableBlend();
|
||||
color(1, 1, 1, 0.3F);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue