Fix some issues when riding.

This commit is contained in:
Matthew Messinger 2016-04-03 01:05:31 -04:00
parent 8bec6f5b85
commit 1d5e22040b
4 changed files with 9 additions and 35 deletions

View file

@ -185,6 +185,8 @@ public abstract class AbstractPonyModel extends ModelPlayer {
}
public void transform(BodyPart part) {
if (this instanceof ModelPlayerPony)
return;
if (this.isRiding) {
translate(0.0F, -0.6F, -0.2F);
}

View file

@ -73,11 +73,6 @@ public class LayerHeldPonyItem implements LayerRenderer<EntityLivingBase> {
if (drop != null) {
pushMatrix();
pony.getModel().transform(BodyPart.LEGS);
if (pony.getModel().isChild) {
translate(0.0F, 0.625F, 0.0F);
rotate(-20.0F, -1.0F, 0.0F, 0.0F);
scale(0.5F, 0.5F, 0.5F);
}
box.postRender(scalefactor * 0.0625F);
translate(posx, posy, posz);

View file

@ -3,11 +3,10 @@ package com.brohoof.minelittlepony.renderer.layer;
import static net.minecraft.client.renderer.GlStateManager.popMatrix;
import static net.minecraft.client.renderer.GlStateManager.pushMatrix;
import static net.minecraft.client.renderer.GlStateManager.rotate;
import static net.minecraft.client.renderer.GlStateManager.scale;
import static net.minecraft.client.renderer.GlStateManager.translate;
import com.brohoof.minelittlepony.PonySize;
import com.brohoof.minelittlepony.ducks.IRenderPony;
import com.brohoof.minelittlepony.model.BodyPart;
import com.brohoof.minelittlepony.model.PlayerModel;
import com.brohoof.minelittlepony.model.pony.ModelHumanPlayer;
@ -38,27 +37,12 @@ public class LayerPonyCape implements LayerRenderer<AbstractClientPlayer> {
&& clientPlayer.isWearing(EnumPlayerModelParts.CAPE) && clientPlayer.getLocationCape() != null) {
pushMatrix();
model.getModel().transform(BodyPart.BODY);
translate(0.0F, 0.24F, 0.0F);
if (model.getModel().metadata.getSize() == PonySize.FOAL) {
translate(0.0F, 0.67F, -0.04F);
scale(0.6F, 0.6F, 0.6F);
} else if (model.getModel().metadata.getSize() == PonySize.LARGE) {
translate(0.0F, -0.14F, -0.1F);
scale(1.15F, 1.2F, 1.2F);
if (model.getModel().isSneak && !model.getModel().isFlying) {
translate(0.0F, 0.03F, 0.0F);
}
} else if (model.getModel().metadata.getSize() == PonySize.TALL) {
translate(0.0F, -0.09F, 0.0F);
scale(1.0F, 1.0F, 1.0F);
if (model.getModel().isSneak && !model.getModel().isFlying) {
translate(0.0F, 0.03F, 0.0F);
}
if (clientPlayer.isRiding()) {
rotate(-36, 1, 0, 0);
}
if (model.getModel().isSneak && !model.getModel().isFlying) {
translate(0.0F, 0.4F, -0.12F);
}
double d = clientPlayer.prevChasingPosX + (clientPlayer.chasingPosX - clientPlayer.prevChasingPosX) * scale
- (clientPlayer.prevPosX + (clientPlayer.posX - clientPlayer.prevPosX) * scale);
double d1 = clientPlayer.prevChasingPosY + (clientPlayer.chasingPosY - clientPlayer.prevChasingPosY) * scale

View file

@ -7,9 +7,9 @@ import static net.minecraft.client.renderer.GlStateManager.rotate;
import static net.minecraft.client.renderer.GlStateManager.scale;
import static net.minecraft.client.renderer.GlStateManager.translate;
import com.brohoof.minelittlepony.PonySize;
import com.brohoof.minelittlepony.ducks.IRenderPony;
import com.brohoof.minelittlepony.model.AbstractPonyModel;
import com.brohoof.minelittlepony.model.BodyPart;
import com.brohoof.minelittlepony.model.PlayerModel;
import com.brohoof.minelittlepony.model.pony.ModelPlayerPony;
import com.mojang.authlib.GameProfile;
@ -50,15 +50,8 @@ public class LayerPonySkull implements LayerRenderer<EntityLivingBase> {
pushMatrix();
boolean isVillager = entity instanceof EntityVillager
|| entity instanceof EntityZombie && ((EntityZombie) entity).isVillager();
if (!isVillager && entity.isChild()) {
scale(0.7, 0.7, 0.7);
}
if (model instanceof ModelPlayerPony) {
if (model.metadata.getSize() == PonySize.FOAL) {
translate(0.0F, 0.76F, 0.0F);
scale(0.9, 0.9, 0.9);
}
}
model.transform(BodyPart.HEAD);
model.bipedHead.postRender(0.0625f);
if (model instanceof ModelPlayerPony) {
translate(0, .2, 0);