Fixed elytra floating off of foal's backs

This commit is contained in:
Sollace 2018-07-08 12:21:57 +02:00
parent 13b1f3385f
commit bb16e157df
5 changed files with 17 additions and 6 deletions

View file

@ -82,7 +82,7 @@ public class RenderPonyModel extends RenderPlayerModel<EntityPonyModel> {
ModelBase model = renderingAsHuman ? modelElytra : ponyElytra; ModelBase model = renderingAsHuman ? modelElytra : ponyElytra;
if (!renderingAsHuman) { 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); model.setRotationAngles(move, swing, ticks, headYaw, headPitch, scale, entity);

View file

@ -728,8 +728,18 @@ public abstract class AbstractPonyModel extends ModelPlayer implements IModel {
} }
@Override @Override
public float getModelOffsetY() { public float getRiderYOffset() {
return 0.25F; 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;
}
} }
/** /**

View file

@ -73,7 +73,7 @@ public interface IModel extends ICapitated {
float getSwingAmount(); float getSwingAmount();
float getModelOffsetY(); float getRiderYOffset();
default boolean isWearing(PonyWearable wearable) { default boolean isWearing(PonyWearable wearable) {
return getMetadata().isWearing(wearable); return getMetadata().isWearing(wearable);

View file

@ -133,7 +133,7 @@ public class ModelSeapony extends ModelUnicorn {
} }
@Override @Override
public float getModelOffsetY() { public float getRiderYOffset() {
return 1.05F; return 1.05F;
} }

View file

@ -35,8 +35,9 @@ public class LayerPonyElytra<T extends EntityLivingBase> extends AbstractPonyLay
getRenderer().bindTexture(getElytraTexture(entity)); getRenderer().bindTexture(getElytraTexture(entity));
GlStateManager.pushMatrix(); GlStateManager.pushMatrix();
GlStateManager.translate(0, getPlayerModel().getModelOffsetY(), 0.125F); GlStateManager.translate(0, getPlayerModel().getRiderYOffset(), 0.125F);
getPlayerModel().transform(BodyPart.BODY); getPlayerModel().transform(BodyPart.BODY);
modelElytra.setRotationAngles(move, swing, ticks, yaw, head, scale, entity); modelElytra.setRotationAngles(move, swing, ticks, yaw, head, scale, entity);
modelElytra.render(entity, move, swing, ticks, yaw, head, scale); modelElytra.render(entity, move, swing, ticks, yaw, head, scale);