mirror of
https://github.com/MineLittlePony/MineLittlePony.git
synced 2024-11-23 04:57:58 +01:00
Fixed elytra floating off of foal's backs
This commit is contained in:
parent
13b1f3385f
commit
bb16e157df
5 changed files with 17 additions and 6 deletions
|
@ -82,7 +82,7 @@ public class RenderPonyModel extends RenderPlayerModel<EntityPonyModel> {
|
|||
ModelBase model = renderingAsHuman ? modelElytra : ponyElytra;
|
||||
|
||||
if (!renderingAsHuman) {
|
||||
GlStateManager.translate(0, ((IModel)getMainModel()).getModelOffsetY(), 0.125F);
|
||||
GlStateManager.translate(0, ((IModel)getMainModel()).getRiderYOffset(), 0.125F);
|
||||
}
|
||||
|
||||
model.setRotationAngles(move, swing, ticks, headYaw, headPitch, scale, entity);
|
||||
|
|
|
@ -728,8 +728,18 @@ public abstract class AbstractPonyModel extends ModelPlayer implements IModel {
|
|||
}
|
||||
|
||||
@Override
|
||||
public float getModelOffsetY() {
|
||||
return 0.25F;
|
||||
public float getRiderYOffset() {
|
||||
if (isChild()) {
|
||||
return 1.05F;
|
||||
}
|
||||
|
||||
switch (getMetadata().getSize()) {
|
||||
case NORMAL: return 0.4F;
|
||||
case FOAL: return 1.05F;
|
||||
case TALL:
|
||||
case LARGE:
|
||||
default: return 0.25F;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -73,7 +73,7 @@ public interface IModel extends ICapitated {
|
|||
|
||||
float getSwingAmount();
|
||||
|
||||
float getModelOffsetY();
|
||||
float getRiderYOffset();
|
||||
|
||||
default boolean isWearing(PonyWearable wearable) {
|
||||
return getMetadata().isWearing(wearable);
|
||||
|
|
|
@ -133,7 +133,7 @@ public class ModelSeapony extends ModelUnicorn {
|
|||
}
|
||||
|
||||
@Override
|
||||
public float getModelOffsetY() {
|
||||
public float getRiderYOffset() {
|
||||
return 1.05F;
|
||||
}
|
||||
|
||||
|
|
|
@ -35,8 +35,9 @@ public class LayerPonyElytra<T extends EntityLivingBase> extends AbstractPonyLay
|
|||
getRenderer().bindTexture(getElytraTexture(entity));
|
||||
|
||||
GlStateManager.pushMatrix();
|
||||
GlStateManager.translate(0, getPlayerModel().getModelOffsetY(), 0.125F);
|
||||
GlStateManager.translate(0, getPlayerModel().getRiderYOffset(), 0.125F);
|
||||
getPlayerModel().transform(BodyPart.BODY);
|
||||
|
||||
modelElytra.setRotationAngles(move, swing, ticks, yaw, head, scale, entity);
|
||||
modelElytra.render(entity, move, swing, ticks, yaw, head, scale);
|
||||
|
||||
|
|
Loading…
Reference in a new issue