mirror of
https://github.com/MineLittlePony/MineLittlePony.git
synced 2025-02-13 16:24:23 +01:00
Model rewrites wave 2, clean up horn rendering, plane rendering, Zombie and Skeleton models
This commit is contained in:
parent
b9e9251c43
commit
52e2c84b67
21 changed files with 400 additions and 371 deletions
|
@ -10,10 +10,16 @@ import javax.annotation.Nonnull;
|
||||||
|
|
||||||
public class ModelHornGlow extends ModelBox {
|
public class ModelHornGlow extends ModelBox {
|
||||||
|
|
||||||
|
private final float alpha;
|
||||||
|
|
||||||
|
private final HornGlowRenderer parent;
|
||||||
|
|
||||||
private TexturedQuad[] quadList;
|
private TexturedQuad[] quadList;
|
||||||
|
|
||||||
public ModelHornGlow(HornGlowRenderer par1ModelRenderer, int par2, int par3, float par4, float par5, float par6, int par7, int par8, int par9, float par10) {
|
public ModelHornGlow(HornGlowRenderer parent, int par2, int par3, float par4, float par5, float par6, int par7, int par8, int par9, float par10, float alpha) {
|
||||||
super(par1ModelRenderer, par2, par3, par4, par5, par6, par7, par8, par9, par10);
|
super(parent, par2, par3, par4, par5, par6, par7, par8, par9, par10);
|
||||||
|
this.parent = parent;
|
||||||
|
this.alpha = alpha;
|
||||||
|
|
||||||
this.quadList = new TexturedQuad[6];
|
this.quadList = new TexturedQuad[6];
|
||||||
float var11 = par4 + par7;
|
float var11 = par4 + par7;
|
||||||
|
@ -29,7 +35,7 @@ public class ModelHornGlow extends ModelBox {
|
||||||
var11 += par10;
|
var11 += par10;
|
||||||
var12 += par10;
|
var12 += par10;
|
||||||
var13 += par10;
|
var13 += par10;
|
||||||
if (par1ModelRenderer.mirror) {
|
if (parent.mirror) {
|
||||||
float var26 = var11;
|
float var26 = var11;
|
||||||
var11 = par4;
|
var11 = par4;
|
||||||
par4 = var26;
|
par4 = var26;
|
||||||
|
@ -46,22 +52,22 @@ public class ModelHornGlow extends ModelBox {
|
||||||
|
|
||||||
this.quadList[0] = new TexturedQuad(new PositionTextureVertex[]{var19, var15, var16, var20},
|
this.quadList[0] = new TexturedQuad(new PositionTextureVertex[]{var19, var15, var16, var20},
|
||||||
par2 + par9 + par7, par3 + par9, par2 + par9 + par7 + par9, par3 + par9 + par8,
|
par2 + par9 + par7, par3 + par9, par2 + par9 + par7 + par9, par3 + par9 + par8,
|
||||||
par1ModelRenderer.textureWidth, par1ModelRenderer.textureHeight);
|
parent.textureWidth, parent.textureHeight);
|
||||||
this.quadList[1] = new TexturedQuad(new PositionTextureVertex[]{var32, var18, var21, var17}, par2,
|
this.quadList[1] = new TexturedQuad(new PositionTextureVertex[]{var32, var18, var21, var17}, par2,
|
||||||
par3 + par9, par2 + par9, par3 + par9 + par8, par1ModelRenderer.textureWidth,
|
par3 + par9, par2 + par9, par3 + par9 + par8, parent.textureWidth,
|
||||||
par1ModelRenderer.textureHeight);
|
parent.textureHeight);
|
||||||
this.quadList[2] = new TexturedQuad(new PositionTextureVertex[]{var19, var18, var32, var15}, par2 + par9,
|
this.quadList[2] = new TexturedQuad(new PositionTextureVertex[]{var19, var18, var32, var15}, par2 + par9,
|
||||||
par3, par2 + par9 + par7, par3 + par9, par1ModelRenderer.textureWidth, par1ModelRenderer.textureHeight);
|
par3, par2 + par9 + par7, par3 + par9, parent.textureWidth, parent.textureHeight);
|
||||||
this.quadList[3] = new TexturedQuad(new PositionTextureVertex[]{var16, var17, var21, var20},
|
this.quadList[3] = new TexturedQuad(new PositionTextureVertex[]{var16, var17, var21, var20},
|
||||||
par2 + par9 + par7, par3 + par9, par2 + par9 + par7 + par7, par3, par1ModelRenderer.textureWidth,
|
par2 + par9 + par7, par3 + par9, par2 + par9 + par7 + par7, par3, parent.textureWidth,
|
||||||
par1ModelRenderer.textureHeight);
|
parent.textureHeight);
|
||||||
this.quadList[4] = new TexturedQuad(new PositionTextureVertex[]{var15, var32, var17, var16}, par2 + par9,
|
this.quadList[4] = new TexturedQuad(new PositionTextureVertex[]{var15, var32, var17, var16}, par2 + par9,
|
||||||
par3 + par9, par2 + par9 + par7, par3 + par9 + par8, par1ModelRenderer.textureWidth,
|
par3 + par9, par2 + par9 + par7, par3 + par9 + par8, parent.textureWidth,
|
||||||
par1ModelRenderer.textureHeight);
|
parent.textureHeight);
|
||||||
this.quadList[5] = new TexturedQuad(new PositionTextureVertex[]{var18, var19, var20, var21},
|
this.quadList[5] = new TexturedQuad(new PositionTextureVertex[]{var18, var19, var20, var21},
|
||||||
par2 + par9 + par7 + par9, par3 + par9, par2 + par9 + par7 + par9 + par7, par3 + par9 + par8,
|
par2 + par9 + par7 + par9, par3 + par9, par2 + par9 + par7 + par9 + par7, par3 + par9 + par8,
|
||||||
par1ModelRenderer.textureWidth, par1ModelRenderer.textureHeight);
|
parent.textureWidth, parent.textureHeight);
|
||||||
if (par1ModelRenderer.mirror) {
|
if (parent.mirror) {
|
||||||
TexturedQuad[] var22 = this.quadList;
|
TexturedQuad[] var22 = this.quadList;
|
||||||
|
|
||||||
for (TexturedQuad var25 : var22) {
|
for (TexturedQuad var25 : var22) {
|
||||||
|
@ -73,6 +79,8 @@ public class ModelHornGlow extends ModelBox {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void render(@Nonnull BufferBuilder buffer, float par2) {
|
public void render(@Nonnull BufferBuilder buffer, float par2) {
|
||||||
|
parent.applyTint(alpha);
|
||||||
|
|
||||||
TexturedQuad[] var3 = this.quadList;
|
TexturedQuad[] var3 = this.quadList;
|
||||||
for (TexturedQuad var6 : var3) {
|
for (TexturedQuad var6 : var3) {
|
||||||
var6.draw(buffer, par2);
|
var6.draw(buffer, par2);
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
package com.minelittlepony.model;
|
package com.minelittlepony.model;
|
||||||
|
|
||||||
public interface PonyModelConstants {
|
public final class PonyModelConstants {
|
||||||
|
|
||||||
float
|
public static final float
|
||||||
BODY_CENTRE_X = 0.0F,
|
BODY_CENTRE_X = 0.0F,
|
||||||
BODY_CENTRE_Y = 8.0F,
|
BODY_CENTRE_Y = 8.0F,
|
||||||
BODY_CENTRE_Z = 6.0F,
|
BODY_CENTRE_Z = 6.0F,
|
||||||
|
|
|
@ -1,73 +0,0 @@
|
||||||
package com.minelittlepony.model;
|
|
||||||
|
|
||||||
import com.minelittlepony.IPonyData;
|
|
||||||
import com.minelittlepony.renderer.HornGlowRenderer;
|
|
||||||
import net.minecraft.client.model.ModelBase;
|
|
||||||
import net.minecraft.client.model.ModelRenderer;
|
|
||||||
import net.minecraft.entity.Entity;
|
|
||||||
import org.lwjgl.opengl.GL11;
|
|
||||||
|
|
||||||
import static net.minecraft.client.renderer.GlStateManager.*;
|
|
||||||
|
|
||||||
public class UnicornHorn extends ModelBase implements PonyModelConstants {
|
|
||||||
|
|
||||||
protected final AbstractPonyModel pony;
|
|
||||||
private ModelRenderer horn;
|
|
||||||
private HornGlowRenderer[] hornglow;
|
|
||||||
|
|
||||||
private boolean usingMagic;
|
|
||||||
|
|
||||||
public UnicornHorn(AbstractPonyModel pony, float yOffset, float stretch) {
|
|
||||||
this.pony = pony;
|
|
||||||
|
|
||||||
this.horn = new ModelRenderer(pony, 0, 3);
|
|
||||||
this.hornglow = new HornGlowRenderer[2];
|
|
||||||
for (int i = 0; i < hornglow.length; i++) {
|
|
||||||
this.hornglow[i] = new HornGlowRenderer(pony, 0, 3);
|
|
||||||
}
|
|
||||||
|
|
||||||
this.horn.addBox(-0.5F + HEAD_CENTRE_X, -10.0F + HEAD_CENTRE_Y, -1.5F + HEAD_CENTRE_Z, 1, 4, 1, stretch);
|
|
||||||
this.horn.setRotationPoint(HEAD_RP_X, HEAD_RP_Y + yOffset, HEAD_RP_Z);
|
|
||||||
this.horn.rotateAngleX = 0.5F;
|
|
||||||
|
|
||||||
this.hornglow[0].addBox(-0.5F + HEAD_CENTRE_X, -10.0F + HEAD_CENTRE_Y, -1.5F + HEAD_CENTRE_Z, 1, 4, 1, stretch + 0.5F);
|
|
||||||
this.hornglow[1].addBox(-0.5F + HEAD_CENTRE_X, -10.0F + HEAD_CENTRE_Y, -1.5F + HEAD_CENTRE_Z, 1, 3, 1, stretch + 0.8F);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void render(Entity entityIn, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scale) {
|
|
||||||
|
|
||||||
IPonyData data = pony.metadata;
|
|
||||||
|
|
||||||
if (data.getRace().hasHorn()) {
|
|
||||||
this.horn.render(scale);
|
|
||||||
if (usingMagic && data.hasMagic()) {
|
|
||||||
GL11.glPushAttrib(24577);
|
|
||||||
disableTexture2D();
|
|
||||||
disableLighting();
|
|
||||||
enableBlend();
|
|
||||||
|
|
||||||
float red = (data.getGlowColor() >> 16 & 255) / 255.0F;
|
|
||||||
float green = (data.getGlowColor() >> 8 & 255) / 255.0F;
|
|
||||||
float blue = (data.getGlowColor() & 255) / 255.0F;
|
|
||||||
blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE);
|
|
||||||
|
|
||||||
this.horn.postRender(scale);
|
|
||||||
|
|
||||||
color(red, green, blue, 0.4F);
|
|
||||||
this.hornglow[0].render(scale);
|
|
||||||
color(red, green, blue, 0.2F);
|
|
||||||
this.hornglow[1].render(scale);
|
|
||||||
|
|
||||||
enableTexture2D();
|
|
||||||
enableLighting();
|
|
||||||
disableBlend();
|
|
||||||
popAttrib();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setUsingMagic(boolean usingMagic) {
|
|
||||||
this.usingMagic = usingMagic;
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,9 +1,13 @@
|
||||||
package com.minelittlepony.model;
|
package com.minelittlepony.model.components;
|
||||||
|
|
||||||
|
import com.minelittlepony.model.AbstractPonyModel;
|
||||||
|
|
||||||
import net.minecraft.client.model.ModelRenderer;
|
import net.minecraft.client.model.ModelRenderer;
|
||||||
|
|
||||||
|
import static com.minelittlepony.model.PonyModelConstants.*;
|
||||||
|
|
||||||
// TODO: Combine each wing into one ModelRenderer with multiple boxes, not multiple ModelRenderers each with one box.
|
// TODO: Combine each wing into one ModelRenderer with multiple boxes, not multiple ModelRenderers each with one box.
|
||||||
public class ModelWing implements PonyModelConstants {
|
public class ModelWing {
|
||||||
public ModelRenderer[] folded = new ModelRenderer[3],
|
public ModelRenderer[] folded = new ModelRenderer[3],
|
||||||
extended = new ModelRenderer[6];
|
extended = new ModelRenderer[6];
|
||||||
|
|
|
@ -1,10 +1,14 @@
|
||||||
package com.minelittlepony.model;
|
package com.minelittlepony.model.components;
|
||||||
|
|
||||||
|
import com.minelittlepony.model.AbstractPonyModel;
|
||||||
|
|
||||||
import net.minecraft.client.model.ModelBase;
|
import net.minecraft.client.model.ModelBase;
|
||||||
import net.minecraft.entity.Entity;
|
import net.minecraft.entity.Entity;
|
||||||
import net.minecraft.util.math.MathHelper;
|
import net.minecraft.util.math.MathHelper;
|
||||||
|
|
||||||
public class PegasusWings extends ModelBase implements PonyModelConstants {
|
import static com.minelittlepony.model.PonyModelConstants.*;
|
||||||
|
|
||||||
|
public class PegasusWings extends ModelBase {
|
||||||
|
|
||||||
private final AbstractPonyModel pony;
|
private final AbstractPonyModel pony;
|
||||||
|
|
|
@ -1,16 +1,14 @@
|
||||||
package com.minelittlepony.model;
|
package com.minelittlepony.model.components;
|
||||||
|
|
||||||
import com.minelittlepony.PonyGender;
|
import com.minelittlepony.PonyGender;
|
||||||
import com.minelittlepony.renderer.PlaneRenderer;
|
import com.minelittlepony.model.AbstractPonyModel;
|
||||||
import net.minecraft.client.model.ModelBase;
|
import com.minelittlepony.renderer.plane.PlaneRenderer;
|
||||||
import net.minecraft.entity.Entity;
|
|
||||||
|
|
||||||
public class PonySnout extends ModelBase implements PonyModelConstants {
|
import static com.minelittlepony.model.PonyModelConstants.*;
|
||||||
|
|
||||||
private PonyGender gender;
|
public class PonySnout {
|
||||||
|
|
||||||
private PlaneRenderer mare;
|
private PlaneRenderer mare, stallion;
|
||||||
private PlaneRenderer stallion;
|
|
||||||
|
|
||||||
public PonySnout(AbstractPonyModel pony, float yOffset, float stretch) {
|
public PonySnout(AbstractPonyModel pony, float yOffset, float stretch) {
|
||||||
mare = new PlaneRenderer(pony);
|
mare = new PlaneRenderer(pony);
|
||||||
|
@ -41,13 +39,8 @@ public class PonySnout extends ModelBase implements PonyModelConstants {
|
||||||
pony.bipedHead.addChild(stallion);
|
pony.bipedHead.addChild(stallion);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
public void setGender(PonyGender gender) {
|
||||||
public void setRotationAngles(float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scaleFactor, Entity entityIn) {
|
|
||||||
mare.isHidden = gender != PonyGender.MARE;
|
mare.isHidden = gender != PonyGender.MARE;
|
||||||
stallion.isHidden = gender != PonyGender.STALLION;
|
stallion.isHidden = gender != PonyGender.STALLION;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setGender(PonyGender gender) {
|
|
||||||
this.gender = gender;
|
|
||||||
}
|
|
||||||
}
|
}
|
|
@ -1,12 +1,14 @@
|
||||||
package com.minelittlepony.model;
|
package com.minelittlepony.model.components;
|
||||||
|
|
||||||
import com.minelittlepony.TailLengths;
|
import com.minelittlepony.TailLengths;
|
||||||
import com.minelittlepony.renderer.PlaneRenderer;
|
import com.minelittlepony.renderer.plane.PlaneRenderer;
|
||||||
|
|
||||||
import net.minecraft.client.model.ModelBase;
|
import net.minecraft.client.model.ModelBase;
|
||||||
import net.minecraft.util.math.MathHelper;
|
import net.minecraft.util.math.MathHelper;
|
||||||
|
|
||||||
public class PonyTail extends PlaneRenderer implements PonyModelConstants {
|
import static com.minelittlepony.model.PonyModelConstants.*;
|
||||||
|
|
||||||
|
public class PonyTail extends PlaneRenderer {
|
||||||
|
|
||||||
private final TailSegment[] segments = new TailSegment[4];
|
private final TailSegment[] segments = new TailSegment[4];
|
||||||
|
|
|
@ -0,0 +1,71 @@
|
||||||
|
package com.minelittlepony.model.components;
|
||||||
|
|
||||||
|
import com.minelittlepony.model.AbstractPonyModel;
|
||||||
|
import com.minelittlepony.renderer.HornGlowRenderer;
|
||||||
|
import net.minecraft.client.model.ModelBase;
|
||||||
|
import net.minecraft.client.model.ModelRenderer;
|
||||||
|
import net.minecraft.entity.Entity;
|
||||||
|
|
||||||
|
import static org.lwjgl.opengl.GL11.*;
|
||||||
|
import static net.minecraft.client.renderer.GlStateManager.*;
|
||||||
|
import static com.minelittlepony.model.PonyModelConstants.*;
|
||||||
|
|
||||||
|
public class UnicornHorn extends ModelBase {
|
||||||
|
static final float
|
||||||
|
hornX = HEAD_CENTRE_X - 0.5F,
|
||||||
|
hornY = HEAD_CENTRE_Y - 10,
|
||||||
|
hornZ = HEAD_CENTRE_Z - 1.5F;
|
||||||
|
|
||||||
|
protected final AbstractPonyModel pony;
|
||||||
|
|
||||||
|
private ModelRenderer horn;
|
||||||
|
|
||||||
|
private HornGlowRenderer glow;
|
||||||
|
|
||||||
|
private boolean usingMagic;
|
||||||
|
|
||||||
|
public UnicornHorn(AbstractPonyModel pony, float yOffset, float stretch) {
|
||||||
|
this.pony = pony;
|
||||||
|
|
||||||
|
horn = new ModelRenderer(pony, 0, 3);
|
||||||
|
glow = new HornGlowRenderer(pony, 0, 3);
|
||||||
|
|
||||||
|
horn.addBox(hornX, hornY, hornZ, 1, 4, 1, stretch);
|
||||||
|
horn.setRotationPoint(HEAD_RP_X, HEAD_RP_Y + yOffset, HEAD_RP_Z);
|
||||||
|
horn.rotateAngleX = 0.5F;
|
||||||
|
|
||||||
|
glow.setAlpha(0.4f).addBox(hornX, hornY, hornZ, 1, 4, 1, stretch + 0.5F);
|
||||||
|
glow.setAlpha(0.2f).addBox(hornX, hornY, hornZ, 1, 3, 1, stretch + 0.8F);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void render(Entity entityIn, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scale) {
|
||||||
|
if (!pony.metadata.getRace().hasHorn()) return;
|
||||||
|
|
||||||
|
this.horn.render(scale);
|
||||||
|
|
||||||
|
if (usingMagic && pony.metadata.hasMagic()) {
|
||||||
|
renderMagic(pony.metadata.getGlowColor(), scale);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void renderMagic(int tint, float scale) {
|
||||||
|
glPushAttrib(24577);
|
||||||
|
disableTexture2D();
|
||||||
|
disableLighting();
|
||||||
|
enableBlend();
|
||||||
|
blendFunc(GL_SRC_ALPHA, GL_ONE);
|
||||||
|
|
||||||
|
horn.postRender(scale);
|
||||||
|
glow.setTint(tint).render(scale);
|
||||||
|
|
||||||
|
enableTexture2D();
|
||||||
|
enableLighting();
|
||||||
|
disableBlend();
|
||||||
|
popAttrib();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUsingMagic(boolean usingMagic) {
|
||||||
|
this.usingMagic = usingMagic;
|
||||||
|
}
|
||||||
|
}
|
113
src/main/java/com/minelittlepony/model/entity/ModelMobPony.java
Normal file
113
src/main/java/com/minelittlepony/model/entity/ModelMobPony.java
Normal file
|
@ -0,0 +1,113 @@
|
||||||
|
package com.minelittlepony.model.entity;
|
||||||
|
|
||||||
|
import static com.minelittlepony.model.PonyModelConstants.*;
|
||||||
|
|
||||||
|
import com.minelittlepony.model.pony.ModelPlayerPony;
|
||||||
|
|
||||||
|
import net.minecraft.client.model.ModelRenderer;
|
||||||
|
import net.minecraft.entity.Entity;
|
||||||
|
import net.minecraft.entity.EntityLivingBase;
|
||||||
|
import net.minecraft.util.math.MathHelper;
|
||||||
|
|
||||||
|
public class ModelMobPony extends ModelPlayerPony {
|
||||||
|
|
||||||
|
public ModelMobPony() {
|
||||||
|
super(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void rotateLegs(float move, float swing, float tick, Entity entity) {
|
||||||
|
float rightArmRotateAngleX;
|
||||||
|
float leftArmRotateAngleX;
|
||||||
|
float rightLegRotateAngleX;
|
||||||
|
float leftLegRotateAngleX;
|
||||||
|
|
||||||
|
float var8;
|
||||||
|
float var9;
|
||||||
|
|
||||||
|
if (this.isFlying && this.metadata.getRace().hasWings() || entity instanceof EntityLivingBase && ((EntityLivingBase) entity).isElytraFlying()) {
|
||||||
|
if (this.rainboom) {
|
||||||
|
rightArmRotateAngleX = ROTATE_270;
|
||||||
|
leftArmRotateAngleX = ROTATE_270;
|
||||||
|
rightLegRotateAngleX = ROTATE_90;
|
||||||
|
leftLegRotateAngleX = ROTATE_90;
|
||||||
|
} else {
|
||||||
|
rightArmRotateAngleX = MathHelper.sin(0.0F - swing * 0.5F);
|
||||||
|
leftArmRotateAngleX = MathHelper.sin(0.0F - swing * 0.5F);
|
||||||
|
rightLegRotateAngleX = MathHelper.sin(swing * 0.5F);
|
||||||
|
leftLegRotateAngleX = MathHelper.sin(swing * 0.5F);
|
||||||
|
}
|
||||||
|
|
||||||
|
this.bipedRightArm.rotateAngleY = 0.2F;
|
||||||
|
this.steveRightArm.rotateAngleY = 0.2F;
|
||||||
|
this.bipedLeftArm.rotateAngleY = -0.2F;
|
||||||
|
this.bipedRightLeg.rotateAngleY = -0.2F;
|
||||||
|
this.bipedLeftLeg.rotateAngleY = 0.2F;
|
||||||
|
} else {
|
||||||
|
var8 = (float) Math.pow(swing, 16.0D);
|
||||||
|
var9 = 3.1415927F * var8 * 0.5F;
|
||||||
|
float laQuad = 3.1415927F * var8;
|
||||||
|
float rlQuad = 3.1415927F * var8 * 0.2F;
|
||||||
|
float llQuad = 3.1415927F * var8 * -0.4F;
|
||||||
|
rightArmRotateAngleX = MathHelper.cos(move * 0.6662F + 3.1415927F + var9) * 0.6F * swing;
|
||||||
|
leftArmRotateAngleX = MathHelper.cos(move * 0.6662F + laQuad) * 0.6F * swing;
|
||||||
|
rightLegRotateAngleX = MathHelper.cos(move * 0.6662F + rlQuad) * 0.6F * swing;
|
||||||
|
leftLegRotateAngleX = MathHelper.cos(move * 0.6662F + 3.1415927F + llQuad) * 0.6F * swing;
|
||||||
|
this.bipedRightArm.rotateAngleY = 0.0F;
|
||||||
|
this.steveRightArm.rotateAngleY = 0.0F;
|
||||||
|
this.unicornArmRight.rotateAngleY = 0.0F;
|
||||||
|
this.bipedLeftArm.rotateAngleY = 0.0F;
|
||||||
|
this.bipedRightLeg.rotateAngleY = 0.0F;
|
||||||
|
this.bipedLeftLeg.rotateAngleY = 0.0F;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.bipedRightArm.rotateAngleX = rightArmRotateAngleX;
|
||||||
|
this.steveRightArm.rotateAngleX = rightArmRotateAngleX;
|
||||||
|
this.unicornArmRight.rotateAngleX = rightArmRotateAngleX;
|
||||||
|
this.bipedLeftArm.rotateAngleX = leftArmRotateAngleX;
|
||||||
|
this.bipedRightLeg.rotateAngleX = rightLegRotateAngleX;
|
||||||
|
this.bipedLeftLeg.rotateAngleX = leftLegRotateAngleX;
|
||||||
|
this.bipedRightArm.rotateAngleZ = 0.0F;
|
||||||
|
this.steveRightArm.rotateAngleZ = 0.0F;
|
||||||
|
this.unicornArmRight.rotateAngleZ = 0.0F;
|
||||||
|
this.bipedLeftArm.rotateAngleZ = 0.0F;
|
||||||
|
|
||||||
|
var8 = MathHelper.sin(this.swingProgress * (float)Math.PI);
|
||||||
|
var9 = MathHelper.sin((1.0F - (1.0F - this.swingProgress) * (1.0F - this.swingProgress)) * 3.1415927F);
|
||||||
|
|
||||||
|
rotateRightArm(var8, var9, move, tick);
|
||||||
|
rotateLeftArm(var8, var9, move, tick);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void rotateRightArm(float var8, float var9, float move, float tick) {
|
||||||
|
if (this.rightArmPose == ArmPose.EMPTY) return;
|
||||||
|
|
||||||
|
if (!this.metadata.hasMagic()) {
|
||||||
|
rotateArmHolding(bipedRightArm, 1, var8, var9, tick);
|
||||||
|
} else {
|
||||||
|
this.unicornArmRight.setRotationPoint(-7, 12, -2);
|
||||||
|
rotateArmHolding(unicornArmRight, 1, var8, var9, tick);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected static void rotateArmHolding(ModelRenderer arm, float direction, float var8, float var9, float tick) {
|
||||||
|
arm.rotateAngleZ = 0.0F;
|
||||||
|
arm.rotateAngleY = direction * (0.1F - var8 * 0.6F);
|
||||||
|
arm.rotateAngleX = -1.5707964F;
|
||||||
|
arm.rotateAngleX -= var8 * 1.2F - var9 * 0.4F;
|
||||||
|
arm.rotateAngleZ += MathHelper.cos(tick * 0.09F) * 0.05F + 0.05F;
|
||||||
|
arm.rotateAngleX += MathHelper.sin(tick * 0.067F) * 0.1F;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
protected void rotateLeftArm(float var8, float var9, float move, float tick) {
|
||||||
|
if (this.leftArmPose == ArmPose.EMPTY) return;
|
||||||
|
|
||||||
|
if (!this.metadata.hasMagic()) {
|
||||||
|
rotateArmHolding(bipedLeftArm, 1, var8, var9, tick);
|
||||||
|
} else {
|
||||||
|
this.unicornArmRight.setRotationPoint(-7, 12, -2);
|
||||||
|
rotateArmHolding(unicornArmLeft, 1, var8, var9, tick);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -2,12 +2,12 @@ package com.minelittlepony.model.pony;
|
||||||
|
|
||||||
import com.minelittlepony.model.AbstractPonyModel;
|
import com.minelittlepony.model.AbstractPonyModel;
|
||||||
import com.minelittlepony.model.BodyPart;
|
import com.minelittlepony.model.BodyPart;
|
||||||
import com.minelittlepony.model.PegasusWings;
|
import com.minelittlepony.model.components.PegasusWings;
|
||||||
import com.minelittlepony.model.PonyModelConstants;
|
import com.minelittlepony.model.components.PonySnout;
|
||||||
import com.minelittlepony.model.PonySnout;
|
import com.minelittlepony.model.components.PonyTail;
|
||||||
import com.minelittlepony.model.PonyTail;
|
import com.minelittlepony.model.components.UnicornHorn;
|
||||||
import com.minelittlepony.model.UnicornHorn;
|
import com.minelittlepony.renderer.plane.PlaneRenderer;
|
||||||
import com.minelittlepony.renderer.PlaneRenderer;
|
|
||||||
import net.minecraft.client.model.ModelRenderer;
|
import net.minecraft.client.model.ModelRenderer;
|
||||||
import net.minecraft.client.renderer.GlStateManager;
|
import net.minecraft.client.renderer.GlStateManager;
|
||||||
import net.minecraft.entity.Entity;
|
import net.minecraft.entity.Entity;
|
||||||
|
@ -17,8 +17,9 @@ import net.minecraft.util.math.MathHelper;
|
||||||
|
|
||||||
import static net.minecraft.client.renderer.GlStateManager.popMatrix;
|
import static net.minecraft.client.renderer.GlStateManager.popMatrix;
|
||||||
import static net.minecraft.client.renderer.GlStateManager.pushMatrix;
|
import static net.minecraft.client.renderer.GlStateManager.pushMatrix;
|
||||||
|
import static com.minelittlepony.model.PonyModelConstants.*;
|
||||||
|
|
||||||
public class ModelPlayerPony extends AbstractPonyModel implements PonyModelConstants {
|
public class ModelPlayerPony extends AbstractPonyModel {
|
||||||
|
|
||||||
private final boolean smallArms;
|
private final boolean smallArms;
|
||||||
public boolean rainboom;
|
public boolean rainboom;
|
||||||
|
@ -143,7 +144,6 @@ public class ModelPlayerPony extends AbstractPonyModel implements PonyModelConst
|
||||||
this.bipedCape.rotationPointY = isSneak ? 2 : isRiding ? -4 : 0;
|
this.bipedCape.rotationPointY = isSneak ? 2 : isRiding ? -4 : 0;
|
||||||
|
|
||||||
this.snout.setGender(this.metadata.getGender());
|
this.snout.setGender(this.metadata.getGender());
|
||||||
this.snout.setRotationAngles(limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scaleFactor, entityIn);
|
|
||||||
this.wings.setRotationAngles(limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scaleFactor, entityIn);
|
this.wings.setRotationAngles(limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scaleFactor, entityIn);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -477,7 +477,8 @@ public class ModelPlayerPony extends AbstractPonyModel implements PonyModelConst
|
||||||
if (leftArm == ArmPose.BOW_AND_ARROW || rightArm == ArmPose.BOW_AND_ARROW) {
|
if (leftArm == ArmPose.BOW_AND_ARROW || rightArm == ArmPose.BOW_AND_ARROW) {
|
||||||
|
|
||||||
if (this.metadata.hasMagic()) {
|
if (this.metadata.hasMagic()) {
|
||||||
aimBowPony(unicornArmRight, tick, true);
|
if (rightArm == ArmPose.BOW_AND_ARROW) aimBowPony(unicornArmRight, tick, true);
|
||||||
|
if (leftArm == ArmPose.BOW_AND_ARROW) aimBowPony(unicornArmLeft, tick, false);
|
||||||
} else {
|
} else {
|
||||||
if (rightArm == ArmPose.BOW_AND_ARROW) aimBowPony(bipedRightArm, tick, false);
|
if (rightArm == ArmPose.BOW_AND_ARROW) aimBowPony(bipedRightArm, tick, false);
|
||||||
if (leftArm == ArmPose.BOW_AND_ARROW) aimBowPony(bipedLeftArm, tick, false);
|
if (leftArm == ArmPose.BOW_AND_ARROW) aimBowPony(bipedLeftArm, tick, false);
|
||||||
|
|
|
@ -1,122 +1,51 @@
|
||||||
package com.minelittlepony.model.pony;
|
package com.minelittlepony.model.pony;
|
||||||
|
|
||||||
import net.minecraft.entity.Entity;
|
|
||||||
import net.minecraft.entity.EntityLivingBase;
|
|
||||||
import net.minecraft.util.math.MathHelper;
|
|
||||||
|
|
||||||
import static net.minecraft.client.renderer.GlStateManager.*;
|
import static net.minecraft.client.renderer.GlStateManager.*;
|
||||||
|
|
||||||
public class ModelSkeletonPony extends ModelPlayerPony {
|
import com.minelittlepony.model.entity.ModelMobPony;
|
||||||
|
|
||||||
|
import net.minecraft.client.model.ModelBiped;
|
||||||
|
import net.minecraft.entity.Entity;
|
||||||
|
import net.minecraft.entity.EntityLivingBase;
|
||||||
|
import net.minecraft.entity.monster.AbstractSkeleton;
|
||||||
|
import net.minecraft.init.Items;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.util.EnumHand;
|
||||||
|
import net.minecraft.util.EnumHandSide;
|
||||||
|
|
||||||
|
public class ModelSkeletonPony extends ModelMobPony {
|
||||||
|
|
||||||
public ModelSkeletonPony() {
|
public ModelSkeletonPony() {
|
||||||
super(false);
|
super();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLivingAnimations(EntityLivingBase entity, float move, float swing, float ticks) {
|
||||||
|
rightArmPose = ModelBiped.ArmPose.EMPTY;
|
||||||
|
leftArmPose = ModelBiped.ArmPose.EMPTY;
|
||||||
|
ItemStack itemstack = entity.getHeldItem(EnumHand.MAIN_HAND);
|
||||||
|
|
||||||
|
if (itemstack.getItem() == Items.BOW && ((AbstractSkeleton)entity).isSwingingArms())
|
||||||
|
{
|
||||||
|
if (entity.getPrimaryHand() == EnumHandSide.RIGHT) {
|
||||||
|
rightArmPose = ModelBiped.ArmPose.BOW_AND_ARROW;
|
||||||
|
} else {
|
||||||
|
leftArmPose = ModelBiped.ArmPose.BOW_AND_ARROW;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
super.setLivingAnimations(entity, move, swing, ticks);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void rotateLegs(float move, float swing, float tick, Entity entity) {
|
protected void rotateLegs(float move, float swing, float tick, Entity entity) {
|
||||||
float rightArmRotateAngleX;
|
super.rotateLegs(move, swing, tick, entity);
|
||||||
float leftArmRotateAngleX;
|
aimBow(leftArmPose, rightArmPose, tick);
|
||||||
float rightLegRotateAngleX;
|
|
||||||
float leftLegRotateAngleX;
|
|
||||||
float var8;
|
|
||||||
float var9;
|
|
||||||
if (this.isFlying && this.metadata.getRace().hasWings() || entity instanceof EntityLivingBase && ((EntityLivingBase) entity).isElytraFlying()) {
|
|
||||||
if (this.rainboom) {
|
|
||||||
rightArmRotateAngleX = ROTATE_270;
|
|
||||||
leftArmRotateAngleX = ROTATE_270;
|
|
||||||
rightLegRotateAngleX = ROTATE_90;
|
|
||||||
leftLegRotateAngleX = ROTATE_90;
|
|
||||||
} else {
|
|
||||||
rightArmRotateAngleX = MathHelper.sin(0.0F - swing * 0.5F);
|
|
||||||
leftArmRotateAngleX = MathHelper.sin(0.0F - swing * 0.5F);
|
|
||||||
rightLegRotateAngleX = MathHelper.sin(swing * 0.5F);
|
|
||||||
leftLegRotateAngleX = MathHelper.sin(swing * 0.5F);
|
|
||||||
}
|
|
||||||
|
|
||||||
this.bipedRightArm.rotateAngleY = 0.2F;
|
|
||||||
this.steveRightArm.rotateAngleY = 0.2F;
|
|
||||||
this.bipedLeftArm.rotateAngleY = -0.2F;
|
|
||||||
this.bipedRightLeg.rotateAngleY = -0.2F;
|
|
||||||
this.bipedLeftLeg.rotateAngleY = 0.2F;
|
|
||||||
} else {
|
|
||||||
var8 = (float) Math.pow(swing, 16.0D);
|
|
||||||
var9 = 3.1415927F * var8 * 0.5F;
|
|
||||||
float laQuad = 3.1415927F * var8;
|
|
||||||
float rlQuad = 3.1415927F * var8 * 0.2F;
|
|
||||||
float llQuad = 3.1415927F * var8 * -0.4F;
|
|
||||||
rightArmRotateAngleX = MathHelper.cos(move * 0.6662F + 3.1415927F + var9) * 0.6F * swing;
|
|
||||||
leftArmRotateAngleX = MathHelper.cos(move * 0.6662F + laQuad) * 0.6F * swing;
|
|
||||||
rightLegRotateAngleX = MathHelper.cos(move * 0.6662F + rlQuad) * 0.6F * swing;
|
|
||||||
leftLegRotateAngleX = MathHelper.cos(move * 0.6662F + 3.1415927F + llQuad) * 0.6F * swing;
|
|
||||||
this.bipedRightArm.rotateAngleY = 0.0F;
|
|
||||||
this.steveRightArm.rotateAngleY = 0.0F;
|
|
||||||
this.unicornArmRight.rotateAngleY = 0.0F;
|
|
||||||
this.bipedLeftArm.rotateAngleY = 0.0F;
|
|
||||||
this.bipedRightLeg.rotateAngleY = 0.0F;
|
|
||||||
this.bipedLeftLeg.rotateAngleY = 0.0F;
|
|
||||||
}
|
|
||||||
|
|
||||||
this.bipedRightArm.rotateAngleX = rightArmRotateAngleX;
|
|
||||||
this.steveRightArm.rotateAngleX = rightArmRotateAngleX;
|
|
||||||
this.unicornArmRight.rotateAngleX = rightArmRotateAngleX;
|
|
||||||
this.bipedLeftArm.rotateAngleX = leftArmRotateAngleX;
|
|
||||||
this.bipedRightLeg.rotateAngleX = rightLegRotateAngleX;
|
|
||||||
this.bipedLeftLeg.rotateAngleX = leftLegRotateAngleX;
|
|
||||||
this.bipedRightArm.rotateAngleZ = 0.0F;
|
|
||||||
this.steveRightArm.rotateAngleZ = 0.0F;
|
|
||||||
this.unicornArmRight.rotateAngleZ = 0.0F;
|
|
||||||
this.bipedLeftArm.rotateAngleZ = 0.0F;
|
|
||||||
if (this.rightArmPose != ArmPose.EMPTY) {
|
|
||||||
var8 = MathHelper.sin(this.swingProgress * 3.1415927F);
|
|
||||||
var9 = MathHelper.sin((1.0F - (1.0F - this.swingProgress) * (1.0F - this.swingProgress)) * 3.1415927F);
|
|
||||||
if (!this.metadata.hasMagic()) {
|
|
||||||
this.bipedRightArm.rotateAngleZ = 0.0F;
|
|
||||||
this.bipedRightArm.rotateAngleY = 0.1F - var8 * 0.6F;
|
|
||||||
this.bipedRightArm.rotateAngleX = -1.5707964F;
|
|
||||||
this.bipedRightArm.rotateAngleX -= var8 * 1.2F - var9 * 0.4F;
|
|
||||||
this.bipedRightArm.rotateAngleZ += MathHelper.cos(tick * 0.09F) * 0.05F + 0.05F;
|
|
||||||
this.bipedRightArm.rotateAngleX += MathHelper.sin(tick * 0.067F) * 0.1F;
|
|
||||||
} else {
|
|
||||||
this.unicornArmRight.rotationPointX = -7.0F;
|
|
||||||
this.unicornArmRight.rotationPointY = 12.0F;
|
|
||||||
this.unicornArmRight.rotationPointZ = -2.0F;
|
|
||||||
this.unicornArmRight.rotateAngleZ = 0.0F;
|
|
||||||
this.unicornArmRight.rotateAngleY = 0.1F - var8 * 0.6F;
|
|
||||||
this.unicornArmRight.rotateAngleX = -1.5707964F;
|
|
||||||
this.unicornArmRight.rotateAngleX -= var8 * 1.2F - var9 * 0.4F;
|
|
||||||
this.unicornArmRight.rotateAngleZ += MathHelper.cos(tick * 0.09F) * 0.05F + 0.05F;
|
|
||||||
this.unicornArmRight.rotateAngleX += MathHelper.sin(tick * 0.067F) * 0.1F;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (this.leftArmPose != ArmPose.EMPTY) {
|
|
||||||
var8 = MathHelper.sin(this.swingProgress * 3.1415927F);
|
|
||||||
var9 = MathHelper.sin((1.0F - (1.0F - this.swingProgress) * (1.0F - this.swingProgress)) * 3.1415927F);
|
|
||||||
if (!this.metadata.hasMagic()) {
|
|
||||||
this.bipedLeftArm.rotateAngleZ = 0.0F;
|
|
||||||
this.bipedLeftArm.rotateAngleY = 0.1F - var8 * 0.6F;
|
|
||||||
this.bipedLeftArm.rotateAngleX = -1.5707964F;
|
|
||||||
this.bipedLeftArm.rotateAngleX -= var8 * 1.2F - var9 * 0.4F;
|
|
||||||
this.bipedLeftArm.rotateAngleZ += MathHelper.cos(tick * 0.09F) * 0.05F + 0.05F;
|
|
||||||
this.bipedLeftArm.rotateAngleX += MathHelper.sin(tick * 0.067F) * 0.1F;
|
|
||||||
} else {
|
|
||||||
this.unicornArmLeft.rotationPointX = -7.0F;
|
|
||||||
this.unicornArmLeft.rotationPointY = 12.0F;
|
|
||||||
this.unicornArmLeft.rotationPointZ = -2.0F;
|
|
||||||
this.unicornArmLeft.rotateAngleZ = 0.0F;
|
|
||||||
this.unicornArmLeft.rotateAngleY = 0.1F - var8 * 0.6F;
|
|
||||||
this.unicornArmLeft.rotateAngleX = -1.5707964F;
|
|
||||||
this.unicornArmLeft.rotateAngleX -= var8 * 1.2F - var9 * 0.4F;
|
|
||||||
this.unicornArmLeft.rotateAngleZ += MathHelper.cos(tick * 0.09F) * 0.05F + 0.05F;
|
|
||||||
this.unicornArmLeft.rotateAngleX += MathHelper.sin(tick * 0.067F) * 0.1F;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
this.aimBow(this.leftArmPose, this.rightArmPose, tick);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void fixSpecialRotationPoints(float move) {
|
protected void fixSpecialRotationPoints(float move) {
|
||||||
if (this.rightArmPose != ArmPose.EMPTY && !this.metadata.hasMagic()) {
|
if (rightArmPose != ArmPose.EMPTY && !metadata.hasMagic()) {
|
||||||
this.bipedRightArm.setRotationPoint(-1.5F, 9.5F, 4.0F);
|
bipedRightArm.setRotationPoint(-1.5F, 9.5F, 4);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -124,13 +53,13 @@ public class ModelSkeletonPony extends ModelPlayerPony {
|
||||||
@Override
|
@Override
|
||||||
protected void renderLegs() {
|
protected void renderLegs() {
|
||||||
pushMatrix();
|
pushMatrix();
|
||||||
translate(0.05F, -0.21F, -0.0F);
|
translate(0.05F, -0.21F, 0);
|
||||||
scale(0.5F, 1.15F, 0.5F);
|
scale(0.5F, 1.15F, 0.5F);
|
||||||
this.bipedLeftArm.render(this.scale);
|
this.bipedLeftArm.render(this.scale);
|
||||||
popMatrix();
|
popMatrix();
|
||||||
|
|
||||||
pushMatrix();
|
pushMatrix();
|
||||||
translate(-0.05F, -0.21F, -0.0F);
|
translate(-0.05F, -0.21F, 0);
|
||||||
scale(0.5F, 1.2F, 0.5F);
|
scale(0.5F, 1.2F, 0.5F);
|
||||||
this.bipedRightArm.render(this.scale);
|
this.bipedRightArm.render(this.scale);
|
||||||
popMatrix();
|
popMatrix();
|
||||||
|
|
|
@ -1,9 +1,11 @@
|
||||||
package com.minelittlepony.model.pony;
|
package com.minelittlepony.model.pony;
|
||||||
|
|
||||||
import com.minelittlepony.renderer.PlaneRenderer;
|
import com.minelittlepony.renderer.plane.PlaneRenderer;
|
||||||
|
|
||||||
import net.minecraft.entity.Entity;
|
import net.minecraft.entity.Entity;
|
||||||
import net.minecraft.entity.passive.EntityVillager;
|
import net.minecraft.entity.passive.EntityVillager;
|
||||||
import net.minecraft.util.math.MathHelper;
|
import net.minecraft.util.math.MathHelper;
|
||||||
|
import static com.minelittlepony.model.PonyModelConstants.*;
|
||||||
|
|
||||||
public class ModelVillagerPony extends ModelPlayerPony {
|
public class ModelVillagerPony extends ModelPlayerPony {
|
||||||
|
|
||||||
|
|
|
@ -1,100 +1,43 @@
|
||||||
package com.minelittlepony.model.pony;
|
package com.minelittlepony.model.pony;
|
||||||
|
|
||||||
import net.minecraft.entity.Entity;
|
|
||||||
import net.minecraft.entity.EntityLivingBase;
|
|
||||||
import net.minecraft.util.math.MathHelper;
|
import net.minecraft.util.math.MathHelper;
|
||||||
|
|
||||||
public class ModelZombiePony extends ModelPlayerPony {
|
import com.minelittlepony.model.entity.ModelMobPony;
|
||||||
|
|
||||||
|
public class ModelZombiePony extends ModelMobPony {
|
||||||
|
|
||||||
public ModelZombiePony() {
|
public ModelZombiePony() {
|
||||||
super(false);
|
super();
|
||||||
|
}
|
||||||
|
|
||||||
|
private boolean isRight(float move) {
|
||||||
|
return MathHelper.sin(move / 20f) < 0f;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void rotateLegs(float move, float swing, float tick, Entity entity) {
|
protected void rotateRightArm(float var8, float var9, float move, float tick) {
|
||||||
float rightArmRotateAngleX;
|
if (this.rightArmPose != ArmPose.EMPTY) return;
|
||||||
float leftArmRotateAngleX;
|
|
||||||
float rightLegRotateAngleX;
|
if (isRight(move)) {
|
||||||
float leftLegRotateAngleX;
|
rotateArmHolding(bipedRightArm, 1, var8, var9, tick);
|
||||||
float var8;
|
|
||||||
float var9;
|
|
||||||
// why are zombies flying?
|
|
||||||
if (this.isFlying && this.metadata.getRace().hasWings() || entity instanceof EntityLivingBase && ((EntityLivingBase) entity).isElytraFlying()) {
|
|
||||||
if (this.rainboom) {
|
|
||||||
rightArmRotateAngleX = ROTATE_270;
|
|
||||||
leftArmRotateAngleX = ROTATE_270;
|
|
||||||
rightLegRotateAngleX = ROTATE_90;
|
|
||||||
leftLegRotateAngleX = ROTATE_90;
|
|
||||||
} else {
|
} else {
|
||||||
rightArmRotateAngleX = MathHelper.sin(0.0F - swing * 0.5F);
|
rotateArmHolding(bipedLeftArm, -1, var8, var9, tick);
|
||||||
leftArmRotateAngleX = MathHelper.sin(0.0F - swing * 0.5F);
|
}
|
||||||
rightLegRotateAngleX = MathHelper.sin(swing * 0.5F);
|
|
||||||
leftLegRotateAngleX = MathHelper.sin(swing * 0.5F);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
this.bipedRightArm.rotateAngleY = 0.2F;
|
@Override
|
||||||
this.steveRightArm.rotateAngleY = 0.2F;
|
protected void rotateLeftArm(float var8, float var9, float move, float tick) {
|
||||||
this.bipedLeftArm.rotateAngleY = -0.2F;
|
|
||||||
this.bipedRightLeg.rotateAngleY = -0.2F;
|
|
||||||
this.bipedLeftLeg.rotateAngleY = 0.2F;
|
|
||||||
} else {
|
|
||||||
var8 = (float) Math.pow(swing, 16.0D);
|
|
||||||
var9 = 3.1415927F * var8 * 0.5F;
|
|
||||||
float laQuad = 3.1415927F * var8;
|
|
||||||
float rlQuad = 3.1415927F * var8 * 0.2F;
|
|
||||||
float llQuad = 3.1415927F * var8 * -0.4F;
|
|
||||||
rightArmRotateAngleX = MathHelper.cos(move * 0.6662F + 3.1415927F + var9) * 0.45F * swing;
|
|
||||||
leftArmRotateAngleX = MathHelper.cos(move * 0.6662F + laQuad) * 0.45F * swing;
|
|
||||||
rightLegRotateAngleX = MathHelper.cos(move * 0.6662F + rlQuad) * 0.45F * swing;
|
|
||||||
leftLegRotateAngleX = MathHelper.cos(move * 0.6662F + 3.1415927F + llQuad) * 0.45F * swing;
|
|
||||||
this.bipedRightArm.rotateAngleY = 0.0F;
|
|
||||||
this.steveRightArm.rotateAngleY = 0.0F;
|
|
||||||
this.unicornArmRight.rotateAngleY = 0.0F;
|
|
||||||
this.bipedLeftArm.rotateAngleY = 0.0F;
|
|
||||||
this.bipedRightLeg.rotateAngleY = 0.0F;
|
|
||||||
this.bipedLeftLeg.rotateAngleY = 0.0F;
|
|
||||||
}
|
|
||||||
|
|
||||||
this.bipedRightArm.rotateAngleX = rightArmRotateAngleX;
|
|
||||||
this.steveRightArm.rotateAngleX = rightArmRotateAngleX;
|
|
||||||
this.unicornArmRight.rotateAngleX = 0.0F;
|
|
||||||
this.bipedLeftArm.rotateAngleX = leftArmRotateAngleX;
|
|
||||||
this.bipedRightLeg.rotateAngleX = rightLegRotateAngleX;
|
|
||||||
this.bipedLeftLeg.rotateAngleX = leftLegRotateAngleX;
|
|
||||||
this.bipedRightArm.rotateAngleZ = 0.0F;
|
|
||||||
this.steveRightArm.rotateAngleZ = 0.0F;
|
|
||||||
this.unicornArmRight.rotateAngleZ = 0.0F;
|
|
||||||
this.bipedLeftArm.rotateAngleZ = 0.0F;
|
|
||||||
if (this.rightArmPose == ArmPose.EMPTY) {
|
|
||||||
var8 = MathHelper.sin(this.swingProgress * (float) Math.PI);
|
|
||||||
var9 = MathHelper.sin((1.0F - (1.0F - this.swingProgress) * (1.0F - this.swingProgress)) * (float) Math.PI);
|
|
||||||
if (MathHelper.sin(move / 20.0F) < 0.0F) {
|
|
||||||
this.bipedRightArm.rotateAngleZ = 0.0F;
|
|
||||||
this.bipedRightArm.rotateAngleY = 0.1F - var8 * 0.6F;
|
|
||||||
this.bipedRightArm.rotateAngleX = -1.5707964F;
|
|
||||||
this.bipedRightArm.rotateAngleX -= var8 * 1.2F - var9 * 0.4F;
|
|
||||||
this.bipedRightArm.rotateAngleZ += MathHelper.cos(tick * 0.09F) * 0.05F + 0.05F;
|
|
||||||
this.bipedRightArm.rotateAngleX += MathHelper.sin(tick * 0.067F) * 0.1F;
|
|
||||||
} else {
|
|
||||||
this.bipedLeftArm.rotateAngleZ = 0.0F;
|
|
||||||
this.bipedLeftArm.rotateAngleY = -(0.1F - var8 * 0.6F);
|
|
||||||
this.bipedLeftArm.rotateAngleX = -1.5707964F;
|
|
||||||
this.bipedLeftArm.rotateAngleX -= var8 * 1.2F - var9 * 0.4F;
|
|
||||||
this.bipedLeftArm.rotateAngleZ += MathHelper.cos(tick * 0.09F) * 0.05F + 0.05F;
|
|
||||||
this.bipedLeftArm.rotateAngleX += MathHelper.sin(tick * 0.067F) * 0.1F;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void fixSpecialRotationPoints(float move) {
|
protected void fixSpecialRotationPoints(float move) {
|
||||||
if (this.rightArmPose == ArmPose.EMPTY) {
|
if (rightArmPose != ArmPose.EMPTY) return;
|
||||||
if (MathHelper.sin(move / 20.0F) < 0.0F) {
|
|
||||||
shiftRotationPoint(this.bipedRightArm, 0.5F, 1.5F, 3.0F);
|
if (isRight(move)) {
|
||||||
|
shiftRotationPoint(bipedRightArm, 0.5F, 1.5F, 3);
|
||||||
} else {
|
} else {
|
||||||
shiftRotationPoint(this.bipedLeftArm, -0.5F, 1.5F, 3.0F);
|
shiftRotationPoint(bipedLeftArm, -0.5F, 1.5F, 3);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,6 +5,8 @@ import net.minecraft.client.model.ModelRenderer;
|
||||||
import net.minecraft.entity.Entity;
|
import net.minecraft.entity.Entity;
|
||||||
import net.minecraft.util.math.MathHelper;
|
import net.minecraft.util.math.MathHelper;
|
||||||
|
|
||||||
|
import static com.minelittlepony.model.PonyModelConstants.*;
|
||||||
|
|
||||||
public class ModelPonyArmor extends ModelPlayerPony {
|
public class ModelPonyArmor extends ModelPlayerPony {
|
||||||
|
|
||||||
public ModelRenderer Bodypiece;
|
public ModelRenderer Bodypiece;
|
||||||
|
|
|
@ -4,6 +4,8 @@ import net.minecraft.entity.Entity;
|
||||||
import net.minecraft.entity.EntityLivingBase;
|
import net.minecraft.entity.EntityLivingBase;
|
||||||
import net.minecraft.util.math.MathHelper;
|
import net.minecraft.util.math.MathHelper;
|
||||||
|
|
||||||
|
import static com.minelittlepony.model.PonyModelConstants.*;
|
||||||
|
|
||||||
public class ModelSkeletonPonyArmor extends ModelPonyArmor {
|
public class ModelSkeletonPonyArmor extends ModelPonyArmor {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -3,6 +3,7 @@ package com.minelittlepony.model.pony.armor;
|
||||||
import net.minecraft.entity.Entity;
|
import net.minecraft.entity.Entity;
|
||||||
import net.minecraft.entity.EntityLivingBase;
|
import net.minecraft.entity.EntityLivingBase;
|
||||||
import net.minecraft.util.math.MathHelper;
|
import net.minecraft.util.math.MathHelper;
|
||||||
|
import static com.minelittlepony.model.PonyModelConstants.*;
|
||||||
|
|
||||||
public class ModelZombiePonyArmor extends ModelPonyArmor {
|
public class ModelZombiePonyArmor extends ModelPonyArmor {
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,49 @@
|
||||||
|
package com.minelittlepony.renderer;
|
||||||
|
|
||||||
|
import net.minecraft.client.model.ModelBase;
|
||||||
|
import net.minecraft.client.model.ModelRenderer;
|
||||||
|
import net.minecraft.client.model.TextureOffset;
|
||||||
|
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
|
public class BasePonyRenderer<T extends BasePonyRenderer<T>> extends ModelRenderer {
|
||||||
|
|
||||||
|
protected final ModelBase baseModel;
|
||||||
|
|
||||||
|
protected int textureOffsetX, textureOffsetY;
|
||||||
|
|
||||||
|
public BasePonyRenderer(ModelBase model) {
|
||||||
|
super(model);
|
||||||
|
baseModel = model;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BasePonyRenderer(ModelBase model, int x, int y) {
|
||||||
|
super(model, x, y);
|
||||||
|
baseModel = model;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public T setTextureOffset(int x, int y) {
|
||||||
|
this.textureOffsetX = x;
|
||||||
|
this.textureOffsetY = y;
|
||||||
|
super.setTextureOffset(x, y);
|
||||||
|
return (T) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public T addBox(String partName, float offX, float offY, float offZ, int width, int height, int depth) {
|
||||||
|
partName = boxName + "." + partName;
|
||||||
|
|
||||||
|
TextureOffset tex = this.baseModel.getTextureOffset(partName);
|
||||||
|
|
||||||
|
setTextureOffset(tex.textureOffsetX, tex.textureOffsetY).addBox(offX, offY, offZ, width, height, depth);
|
||||||
|
cubeList.get(cubeList.size() - 1).setBoxName(partName);
|
||||||
|
|
||||||
|
return (T) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public T addBox(float offX, float offY, float offZ, int width, int height, int depth) {
|
||||||
|
addBox(offX, offY, offZ, width, height, depth, 0);
|
||||||
|
return (T) this;
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,51 +1,44 @@
|
||||||
package com.minelittlepony.renderer;
|
package com.minelittlepony.renderer;
|
||||||
|
|
||||||
|
import static net.minecraft.client.renderer.GlStateManager.color;
|
||||||
|
|
||||||
import com.minelittlepony.model.ModelHornGlow;
|
import com.minelittlepony.model.ModelHornGlow;
|
||||||
import net.minecraft.client.model.ModelBase;
|
import net.minecraft.client.model.ModelBase;
|
||||||
import net.minecraft.client.model.ModelRenderer;
|
|
||||||
import net.minecraft.client.model.TextureOffset;
|
|
||||||
|
|
||||||
public class HornGlowRenderer extends ModelRenderer {
|
public class HornGlowRenderer extends BasePonyRenderer<HornGlowRenderer> {
|
||||||
|
|
||||||
private int textureOffsetX;
|
float r, g, b, a = 1;
|
||||||
private int textureOffsetY;
|
|
||||||
private ModelBase baseModel;
|
|
||||||
|
|
||||||
public HornGlowRenderer(ModelBase par1ModelBase) {
|
public HornGlowRenderer(ModelBase model, int x, int y) {
|
||||||
super(par1ModelBase);
|
super(model, x, y);
|
||||||
this.baseModel = par1ModelBase;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public HornGlowRenderer(ModelBase par1ModelBase, int par2, int par3) {
|
public HornGlowRenderer setAlpha(float a) {
|
||||||
this(par1ModelBase);
|
this.a = a;
|
||||||
this.setTextureSize(par2, par3);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public HornGlowRenderer addBox(String par1Str, float par2, float par3, float par4, int par5, int par6, int par7) {
|
|
||||||
par1Str = this.boxName + "." + par1Str;
|
|
||||||
TextureOffset var8 = this.baseModel.getTextureOffset(par1Str);
|
|
||||||
this.setTextureOffset(var8.textureOffsetX, var8.textureOffsetY);
|
|
||||||
this.cubeList.add((new ModelHornGlow(this, this.textureOffsetX, this.textureOffsetY, par2, par3, par4, par5, par6, par7, 0.0F)).setBoxName(par1Str));
|
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
public HornGlowRenderer setTint(int tint) {
|
||||||
public HornGlowRenderer addBox(float par1, float par2, float par3, int par4, int par5, int par6) {
|
r = (tint >> 16 & 255) / 255.0F;
|
||||||
this.cubeList.add(new ModelHornGlow(this, this.textureOffsetX, this.textureOffsetY, par1, par2, par3, par4, par5, par6, 0.0F));
|
g = (tint >> 8 & 255) / 255.0F;
|
||||||
|
b = (tint & 255) / 255.0F;
|
||||||
|
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
public void applyTint(float alpha) {
|
||||||
public void addBox(float par1, float par2, float par3, int par4, int par5, int par6, float par7) {
|
color(r, g, b, alpha);
|
||||||
this.cubeList.add(new ModelHornGlow(this, this.textureOffsetX, this.textureOffsetY, par1, par2, par3, par4, par5, par6, par7));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ModelRenderer setTextureOffset(int x, int y) {
|
public void addBox(float offX, float offY, float offZ, int width, int height, int depth, float scaleFactor) {
|
||||||
this.textureOffsetX = x;
|
this.cubeList.add(new ModelHornGlow(this, textureOffsetX, textureOffsetY, offX, offY, offZ, width, height, depth, scaleFactor, a));
|
||||||
this.textureOffsetY = y;
|
}
|
||||||
return this;
|
|
||||||
|
@Override
|
||||||
|
public void render(float scale) {
|
||||||
|
super.render(scale);
|
||||||
|
color(1, 1, 1, 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,7 @@
|
||||||
|
package com.minelittlepony.renderer.plane;
|
||||||
|
|
||||||
|
enum Face {
|
||||||
|
WEST, EAST,
|
||||||
|
UP, DOWN,
|
||||||
|
NORTH, SOUTH
|
||||||
|
}
|
|
@ -1,6 +1,5 @@
|
||||||
package com.minelittlepony.model;
|
package com.minelittlepony.renderer.plane;
|
||||||
|
|
||||||
import com.minelittlepony.renderer.PlaneRenderer;
|
|
||||||
import net.minecraft.client.model.ModelBox;
|
import net.minecraft.client.model.ModelBox;
|
||||||
import net.minecraft.client.model.PositionTextureVertex;
|
import net.minecraft.client.model.PositionTextureVertex;
|
||||||
import net.minecraft.client.model.TexturedQuad;
|
import net.minecraft.client.model.TexturedQuad;
|
||||||
|
@ -109,13 +108,4 @@ public class ModelPlane extends ModelBox {
|
||||||
public void render(@Nonnull BufferBuilder renderer, float scale) {
|
public void render(@Nonnull BufferBuilder renderer, float scale) {
|
||||||
if (!hidden) this.quad.draw(renderer, scale);
|
if (!hidden) this.quad.draw(renderer, scale);
|
||||||
}
|
}
|
||||||
|
|
||||||
public enum Face {
|
|
||||||
EAST,
|
|
||||||
WEST,
|
|
||||||
DOWN,
|
|
||||||
UP,
|
|
||||||
SOUTH,
|
|
||||||
NORTH
|
|
||||||
}
|
|
||||||
}
|
}
|
|
@ -1,17 +1,13 @@
|
||||||
package com.minelittlepony.renderer;
|
package com.minelittlepony.renderer.plane;
|
||||||
|
|
||||||
|
import com.minelittlepony.renderer.BasePonyRenderer;
|
||||||
|
|
||||||
import com.minelittlepony.model.ModelPlane;
|
|
||||||
import com.minelittlepony.model.ModelPlane.Face;
|
|
||||||
import net.minecraft.client.model.ModelBase;
|
import net.minecraft.client.model.ModelBase;
|
||||||
import net.minecraft.client.model.ModelRenderer;
|
|
||||||
|
|
||||||
@SuppressWarnings("unused")
|
public class PlaneRenderer extends BasePonyRenderer<PlaneRenderer> {
|
||||||
public class PlaneRenderer extends ModelRenderer {
|
|
||||||
|
|
||||||
public boolean mirrory, mirrorz;
|
public boolean mirrory, mirrorz;
|
||||||
|
|
||||||
private int textureOffsetX, textureOffsetY;
|
|
||||||
|
|
||||||
public PlaneRenderer(ModelBase model) {
|
public PlaneRenderer(ModelBase model) {
|
||||||
super(model);
|
super(model);
|
||||||
}
|
}
|
||||||
|
@ -20,16 +16,8 @@ public class PlaneRenderer extends ModelRenderer {
|
||||||
super(model, x, y);
|
super(model, x, y);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public PlaneRenderer setTextureOffset(int x, int y) {
|
|
||||||
this.textureOffsetX = x;
|
|
||||||
this.textureOffsetY = y;
|
|
||||||
super.setTextureOffset(x, y);
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void addPlane(float offX, float offY, float offZ, int width, int height, int depth, float scale, Face face) {
|
private void addPlane(float offX, float offY, float offZ, int width, int height, int depth, float scale, Face face) {
|
||||||
this.cubeList.add(new ModelPlane(this, this.textureOffsetX, this.textureOffsetY, offX, offY, offZ, width, height, depth, scale, face));
|
this.cubeList.add(new ModelPlane(this, textureOffsetX, textureOffsetY, offX, offY, offZ, width, height, depth, scale, face));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void addTopPlane(float offX, float offY, float offZ, int width, int depth, float scale) {
|
public void addTopPlane(float offX, float offY, float offZ, int width, int depth, float scale) {
|
Loading…
Reference in a new issue