Fix arm swinging with human's

This commit is contained in:
Matthew Messinger 2015-08-17 01:51:02 -04:00
parent 5895579412
commit 50b0b668c7
3 changed files with 40 additions and 17 deletions

View file

@ -5,6 +5,7 @@ import com.minelittlepony.minelp.renderer.AniParams;
import net.minecraft.client.entity.AbstractClientPlayer; import net.minecraft.client.entity.AbstractClientPlayer;
import net.minecraft.client.model.ModelPlayer; import net.minecraft.client.model.ModelPlayer;
import net.minecraft.client.renderer.entity.RenderPlayer;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EnumPlayerModelParts; import net.minecraft.entity.player.EnumPlayerModelParts;
import net.minecraft.item.EnumAction; import net.minecraft.item.EnumAction;
@ -62,6 +63,44 @@ public abstract class ModelPony extends ModelPlayer {
} }
} }
@Override
public final void renderRightArm() {
// Use the human model
PMAPI.human.model.renderModelRightArm();
}
@Override
public final void renderLeftArm() {
// Use the human model
PMAPI.human.model.renderModelLeftArm();
}
@Override
public final void setRotationAngles(float f1, float f2, float f3, float f4, float f5, float f6, Entity ent) {
// set the angles for the humans in preparation for arm rendering
StackTraceElement[] stack = Thread.currentThread().getStackTrace();
// Comes from RenderPlayer.render[Left|Right]Arm?
if (stack[2].getClassName().equals(RenderPlayer.class.getName())) {
PMAPI.human.model.setModelVisibilities((AbstractClientPlayer) ent);
PMAPI.human.model.isSneak = isSneak;
PMAPI.human.model.swingProgress = swingProgress;
PMAPI.human.model.setModelRotationAngles(f1, f2, f3, f4, f5, f6, ent);
}
setModelRotationAngles(f1, f2, f3, f4, f5, f6, ent);
}
public void renderModelRightArm() {
super.renderRightArm();
}
public void renderModelLeftArm() {
super.renderLeftArm();
}
public void setModelRotationAngles(float f1, float f2, float f3, float f4, float f5, float f6, Entity ent) {
super.setRotationAngles(f1, f2, f3, f4, f5, f6, ent);
}
protected void setModelVisibilities(AbstractClientPlayer clientPlayer) { protected void setModelVisibilities(AbstractClientPlayer clientPlayer) {
ModelPlayer modelplayer = this; ModelPlayer modelplayer = this;

View file

@ -8,7 +8,6 @@ import org.lwjgl.opengl.GL11;
import com.minelittlepony.minelp.PonyManager; import com.minelittlepony.minelp.PonyManager;
import com.minelittlepony.minelp.model.ModelPony; import com.minelittlepony.minelp.model.ModelPony;
import com.minelittlepony.minelp.model.PMAPI;
import com.minelittlepony.minelp.renderer.AniParams; import com.minelittlepony.minelp.renderer.AniParams;
import com.minelittlepony.minelp.renderer.CompressiveRendering; import com.minelittlepony.minelp.renderer.CompressiveRendering;
import com.minelittlepony.minelp.renderer.HornGlowRenderer; import com.minelittlepony.minelp.renderer.HornGlowRenderer;
@ -348,13 +347,9 @@ public class pm_newPonyAdv extends ModelPony {
} else { } else {
float swag = (float) Math.pow(swing, 16.0D); float swag = (float) Math.pow(swing, 16.0D);
this.getClass();
float raQuad = 3.1415927F * swag * 0.5F; float raQuad = 3.1415927F * swag * 0.5F;
this.getClass();
float laQuad = 3.1415927F * swag; float laQuad = 3.1415927F * swag;
this.getClass();
float rlQuad = 3.1415927F * swag * 0.2F; float rlQuad = 3.1415927F * swag * 0.2F;
this.getClass();
float llQuad = 3.1415927F * swag * -0.4F; float llQuad = 3.1415927F * swag * -0.4F;
rightArmRotateAngleX = MathHelper.cos(move * 0.6662F + 3.1415927F + raQuad) * 0.45F * swing; rightArmRotateAngleX = MathHelper.cos(move * 0.6662F + 3.1415927F + raQuad) * 0.45F * swing;
leftArmRotateAngleX = MathHelper.cos(move * 0.6662F + laQuad) * 0.45F * swing; leftArmRotateAngleX = MathHelper.cos(move * 0.6662F + laQuad) * 0.45F * swing;
@ -695,7 +690,6 @@ public class pm_newPonyAdv extends ModelPony {
this.Bodypiece[13].rotateAngleX += 0.5F; this.Bodypiece[13].rotateAngleX += 0.5F;
} }
protected void fixSpecialRotationPoints(float move) {} protected void fixSpecialRotationPoints(float move) {}
public void shiftRotationPoint(PlaneRenderer aPlaneRenderer, float shiftX, float shiftY, float shiftZ) { public void shiftRotationPoint(PlaneRenderer aPlaneRenderer, float shiftX, float shiftY, float shiftZ) {
@ -992,16 +986,6 @@ public class pm_newPonyAdv extends ModelPony {
} }
} }
@Override
public void renderRightArm() {
copyModelAngles(PMAPI.human.model.bipedRightArm, SteveArm);
this.SteveArm.render(0.0625f);
copyModelAngles(PMAPI.human.model.bipedRightArm, unicornarm);
this.unicornarm.showModel = this.bipedRightArmwear.showModel;
this.unicornarm.render(0.0625f);
}
protected void initTextures() { protected void initTextures() {
this.Tail = new PlaneRenderer[21]; this.Tail = new PlaneRenderer[21];
this.headpiece = new ModelRenderer[3]; this.headpiece = new ModelRenderer[3];

View file

@ -6,7 +6,7 @@ minelp.options.ponylevel=Pony Level
minelp.options.ponylevel.pony=Ponies minelp.options.ponylevel.pony=Ponies
minelp.options.ponylevel.human=Humans minelp.options.ponylevel.human=Humans
minelp.options.ponylevel.mix=Mix minelp.options.ponylevel.mix=Mix
minelp.options.options=Pony Options (Dsd) minelp.options.options=Pony Options
minelp.options.hd=Enable MineLP skin server (requries restart) minelp.options.hd=Enable MineLP skin server (requries restart)
minelp.options.sizes=Allow all different sizes of pony minelp.options.sizes=Allow all different sizes of pony
minelp.options.ponyarmor=Use Mine Little Pony compatible armor minelp.options.ponyarmor=Use Mine Little Pony compatible armor