mirror of
https://github.com/MineLittlePony/MineLittlePony.git
synced 2025-02-13 16:24:23 +01:00
Center and align players and mobs to the same position whilst riding
This commit is contained in:
parent
04d2dac5e8
commit
1afc1cc301
2 changed files with 10 additions and 2 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue