Center and align players and mobs to the same position whilst riding

This commit is contained in:
Sollace 2018-06-02 23:27:59 +02:00
parent 04d2dac5e8
commit 1afc1cc301
2 changed files with 10 additions and 2 deletions

View file

@ -71,7 +71,11 @@ public abstract class RenderPonyMob<T extends EntityLiving> extends RenderLiving
float s = getScaleFactor();
GlStateManager.scale(s, s, s);
GlStateManager.translate(0, 0, -entity.width / 2); // move us to the center of the shadow
if (!entity.isRiding()) {
GlStateManager.translate(0, 0, -entity.width / 2); // move us to the center of the shadow
} else {
GlStateManager.translate(0, entity.getYOffset(), 0);
}
}
@Override

View file

@ -60,7 +60,11 @@ public abstract class RenderPonyBase extends RenderPlayer implements IRenderPony
float s = getScaleFactor();
GlStateManager.scale(s, s, s);
GlStateManager.translate(0, 0, -player.width / 2); // move us to the center of the shadow
if (!player.isRiding()) {
GlStateManager.translate(0, 0, -player.width / 2); // move us to the center of the shadow
} else {
GlStateManager.translate(0, player.getYOffset(), 0);
}
}
@Override