Add model parts. Various improvements and removing of dead or obsolete classes/methods

This commit is contained in:
Matthew Messinger 2015-12-14 03:29:10 -05:00
parent cbe19c4732
commit e8021bc2fd
25 changed files with 988 additions and 1966 deletions

View file

@ -0,0 +1,9 @@
package com.brohoof.minelittlepony.model;
public enum BodyPart {
HEAD,
BODY,
TAIL,
NECK,
LEGS,
}

View file

@ -2,31 +2,20 @@ package com.brohoof.minelittlepony.model;
import com.brohoof.minelittlepony.renderer.HornGlowRenderer;
import net.minecraft.client.model.ModelBox;
import net.minecraft.client.model.PositionTextureVertex;
import net.minecraft.client.model.TexturedQuad;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.WorldRenderer;
public class ModelHornGlow extends ModelBox {
public class ModelHornGlow {
private PositionTextureVertex[] vertexPositions;
private TexturedQuad[] quadList;
public final float posX1;
public final float posY1;
public final float posZ1;
public final float posX2;
public final float posY2;
public final float posZ2;
public String field_78247_g;
@SuppressWarnings("unused")
public ModelHornGlow(HornGlowRenderer par1ModelRenderer, int par2, int par3, float par4, float par5, float par6,
int par7, int par8, int par9, float par10) {
this.posX1 = par4;
this.posY1 = par5;
this.posZ1 = par6;
this.posX2 = par4 + par7;
this.posY2 = par5 + par8;
this.posZ2 = par6 + par9;
this.vertexPositions = new PositionTextureVertex[8];
public ModelHornGlow(HornGlowRenderer par1ModelRenderer, int par2, int par3, float par4, float par5, float par6, int par7, int par8, int par9, float par10) {
super(par1ModelRenderer, par2, par3, par4, par5, par6, par7, par8, par9, par10);
PositionTextureVertex[] vertexPositions = new PositionTextureVertex[8];
this.quadList = new TexturedQuad[6];
float var11 = par4 + par7;
float var12 = par5 + par8;
@ -57,14 +46,7 @@ public class ModelHornGlow {
PositionTextureVertex var19 = new PositionTextureVertex(halfvar11, par5, halfvar13, 0.0F, 8.0F);
PositionTextureVertex var20 = new PositionTextureVertex(var11, var12, var13, 8.0F, 8.0F);
PositionTextureVertex var21 = new PositionTextureVertex(par4, var12, var13, 8.0F, 0.0F);
this.vertexPositions[0] = var32;
this.vertexPositions[1] = var15;
this.vertexPositions[2] = var16;
this.vertexPositions[3] = var17;
this.vertexPositions[4] = var18;
this.vertexPositions[5] = var19;
this.vertexPositions[6] = var20;
this.vertexPositions[7] = var21;
this.quadList[0] = new TexturedQuad(new PositionTextureVertex[] { var19, var15, var16, var20 },
par2 + par9 + par7, par3 + par9, par2 + par9 + par7 + par9, par3 + par9 + par8,
par1ModelRenderer.textureWidth, par1ModelRenderer.textureHeight);
@ -92,16 +74,12 @@ public class ModelHornGlow {
}
public void render(Tessellator par1Tessellator, float par2) {
@Override
public void render(WorldRenderer renderer, float par2) {
TexturedQuad[] var3 = this.quadList;
for (TexturedQuad var6 : var3) {
var6.draw(par1Tessellator.getWorldRenderer(), par2);
var6.draw(renderer, par2);
}
}
public ModelHornGlow func_78244_a(String par1Str) {
this.field_78247_g = par1Str;
return this;
}
}

View file

@ -1,13 +1,27 @@
package com.brohoof.minelittlepony.model;
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 java.util.List;
import com.brohoof.minelittlepony.MineLittlePony;
import com.brohoof.minelittlepony.Pony;
import com.brohoof.minelittlepony.PonyData;
import com.brohoof.minelittlepony.PonySize;
import com.brohoof.minelittlepony.model.part.IPonyPart;
import com.brohoof.minelittlepony.model.pony.pm_newPonyAdv;
import com.brohoof.minelittlepony.renderer.AniParams;
import com.brohoof.minelittlepony.renderer.PlaneRenderer;
import com.google.common.collect.Lists;
import net.minecraft.client.Minecraft;
import net.minecraft.client.entity.AbstractClientPlayer;
import net.minecraft.client.model.ModelBase;
import net.minecraft.client.model.ModelPlayer;
import net.minecraft.client.model.ModelRenderer;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.renderer.entity.RenderPlayer;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EnumPlayerModelParts;
@ -16,44 +30,35 @@ import net.minecraft.item.ItemStack;
public abstract class ModelPony extends ModelPlayer {
protected float strech = 0.0F;
protected float scale = 0.0625F;
public boolean issneak = false;
public boolean isArmour = false;
public boolean isVillager;
public boolean isFlying;
public boolean isGlow;
public boolean isSleeping;
public PonyData metadata = new PonyData();
public int heldItemLeft;
public int heldItemRight;
public boolean aimedBow;
protected List<IPonyPart> modelParts = Lists.newArrayList();
public ModelPony() {
super(0, false);
}
public void setStrech(float strech) {
this.strech = strech;
public final void init(float yOffset, float stretch) {
this.initTextures();
this.initPositions(yOffset, stretch);
for (IPonyPart part : modelParts) {
part.init(this, yOffset, stretch);
}
}
/**
* @param var1
* @param var2
*/
public void init(float var1, float var2) {}
protected void initTextures() {}
/**
* @param var1
*/
public void animate(AniParams var1) {}
protected void initPositions(float yOffset, float stretch) {}
/**
* @param var1
*/
public void render(AniParams var1) {}
protected void animate(AniParams var1) {}
protected void render() {}
@Override
public void render(Entity player, float Move, float Moveswing, float Loop, float Right, float Down, float Scale) {
@ -63,7 +68,17 @@ public abstract class ModelPony extends ModelPlayer {
if (!doCancelRender()) {
AniParams ani = new AniParams(Move, Moveswing, Loop, Right, Down);
this.animate(ani);
this.render(ani);
for (IPonyPart part : modelParts) {
part.animate(metadata, ani);
}
GlStateManager.pushMatrix();
this.render();
GlStateManager.popMatrix();
for (IPonyPart part : modelParts) {
GlStateManager.pushMatrix();
part.render(metadata, scale);
GlStateManager.popMatrix();
}
} else {
super.render(player, Move, Moveswing, Loop, Right, Down, Scale);
}
@ -98,15 +113,15 @@ public abstract class ModelPony extends ModelPlayer {
setModelRotationAngles(f1, f2, f3, f4, f5, f6, ent);
}
public void renderModelRightArm() {
protected void renderModelRightArm() {
super.renderRightArm();
}
public void renderModelLeftArm() {
protected void renderModelLeftArm() {
super.renderLeftArm();
}
public void setModelRotationAngles(float f1, float f2, float f3, float f4, float f5, float f6, Entity ent) {
protected 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);
}
@ -152,4 +167,166 @@ public abstract class ModelPony extends ModelPlayer {
return false;
}
public void setRotationPoint(ModelRenderer aRenderer, float setX, float setY, float setZ) {
aRenderer.rotationPointX = setX;
aRenderer.rotationPointY = setY;
aRenderer.rotationPointZ = setZ;
}
public void setRotationPoint(PlaneRenderer aPlaneRenderer, float setX, float setY, float setZ) {
aPlaneRenderer.rotationPointX = setX;
aPlaneRenderer.rotationPointY = setY;
aPlaneRenderer.rotationPointZ = setZ;
}
public void shiftRotationPoint(PlaneRenderer aPlaneRenderer, float shiftX, float shiftY, float shiftZ) {
aPlaneRenderer.rotationPointX += shiftX;
aPlaneRenderer.rotationPointY += shiftY;
aPlaneRenderer.rotationPointZ += shiftZ;
}
public void shiftRotationPoint(ModelRenderer aRenderer, float shiftX, float shiftY, float shiftZ) {
aRenderer.rotationPointX += shiftX;
aRenderer.rotationPointY += shiftY;
aRenderer.rotationPointZ += shiftZ;
}
public void transform(BodyPart part) {
if (this.isRiding && !this.isArmour) {
translate(0.0F, -0.56F, -0.46F);
}
if (this.isSleeping && !this.isArmour) {
rotate(90.0F, 0.0F, 1.0F, 0.0F);
rotate(270.0F, 0.0F, 0.0F, 1.0F);
rotate(90.0F, 0.0F, 1.0F, 0.0F);
rotate(180.0F, 0.0F, 0.0F, 1.0F);
rotate(180.0F, 0.0F, 1.0F, 0.0F);
}
if (this.metadata.getSize() == PonySize.FOAL) {
if (this.isSneak && !this.isFlying && !this.isArmour) {
translate(0.0F, -0.12F, 0.0F);
}
if (this.isSleeping && !this.isArmour) {
translate(0.0F, -1.0F, 0.25F);
}
switch (part) {
case NECK:
case HEAD:
translate(0.0F, 0.76F, 0.0F);
scale(0.9F, 0.9F, 0.9F);
if (part == BodyPart.HEAD)
break;
if (this.isSneak && !this.isFlying) {
translate(0.0F, -0.01F, 0.15F);
}
break;
case BODY:
case TAIL:
translate(0.0F, 0.76F, -0.04F);
scale(0.6F, 0.6F, 0.6F);
break;
case LEGS:
translate(0.0F, 0.89F, 0.0F);
scale(0.6F, 0.41F, 0.6F);
if (this.isSneak && !this.isFlying) {
translate(0.0F, 0.12F, 0.0F);
}
if (this instanceof pm_newPonyAdv && ((pm_newPonyAdv) this).rainboom) {
translate(0.0F, -0.08F, 0.0F);
}
break;
}
} else if (this.metadata.getSize() == PonySize.LARGE) {
if (this.isSleeping && !this.isArmour) {
translate(0.0F, -0.47F, 0.2F);
}
switch (part) {
case HEAD:
translate(0.0F, -0.17F, -0.04F);
if (this.isSleeping && !this.isArmour) {
translate(0.0F, 0.0F, -0.1F);
}
if (this.isSneak && !this.isFlying) {
translate(0.0F, 0.15F, 0.0F);
}
break;
case NECK:
translate(0.0F, -0.15F, -0.07F);
if (this.isSneak && !this.isFlying) {
translate(0.0F, 0.0F, -0.05F);
}
break;
case BODY:
translate(0.0F, -0.2F, -0.04F);
scale(1.15F, 1.2F, 1.2F);
break;
case TAIL:
translate(0.0F, -0.2F, 0.08F);
break;
case LEGS:
translate(0.0F, -0.14F, 0.0F);
scale(1.15F, 1.12F, 1.15F);
break;
}
} else if (this.metadata.getSize() == PonySize.PRINCESS) {
if (this.isSleeping && !this.isArmour) {
translate(0.0F, -0.43F, 0.25F);
}
switch (part) {
case HEAD:
translate(0.0F, -0.15F, 0.01F);
if (this.isSneak && !this.isFlying) {
translate(0.0F, 0.05F, 0.0F);
}
break;
case NECK:
translate(0.0F, -0.19F, -0.01F);
scale(1.0F, 1.1F, 1.0F);
if (this.isSneak && !this.isFlying) {
translate(0.0F, -0.06F, -0.04F);
}
break;
case BODY:
case TAIL:
translate(0.0F, -0.1F, 0.0F);
scale(1.0F, 1.0F, 1.0F);
break;
case LEGS:
translate(0.0F, -0.25F, 0.03F);
scale(1.0F, 1.18F, 1.0F);
if (this instanceof pm_newPonyAdv && ((pm_newPonyAdv) this).rainboom) {
translate(0.0F, 0.05F, 0.0F);
}
break;
}
} else {
if (this.isSleeping && !this.isArmour) {
translate(0.0F, -0.535F, 0.25F);
}
}
}
@Override
public void setModelAttributes(ModelBase model) {
super.setModelAttributes(model);
if (model instanceof ModelPony) {
ModelPony pony = (ModelPony) model;
this.isFlying = pony.isFlying;
this.isSleeping = pony.isSleeping;
this.isVillager = pony.isVillager;
}
}
}

View file

@ -0,0 +1,59 @@
package com.brohoof.minelittlepony.model;
public interface PonyModelConstants {
float BODY_CENTRE_X = 0.0F;
float BODY_CENTRE_Y = 8.0F;
float BODY_CENTRE_Z = 6.0F;
float BODY_ROTATE_ANGLE_X_NOTSNEAK = 0.0F;
float BODY_ROTATE_ANGLE_X_SNEAK = 0.4F;
float BODY_RP_Y_NOTSNEAK = 0.0F;
float BODY_RP_Y_SNEAK = 7.0F;
float BODY_RP_Z_NOTSNEAK = 0.0F;
float BODY_RP_Z_SNEAK = -4.0F;
float EXT_WING_ROTATE_ANGLE_X = 2.5F;
float FIRSTP_ARM_CENTRE_X = -1.0F;
float FIRSTP_ARM_CENTRE_Y = 4.0F;
float FIRSTP_ARM_CENTRE_Z = 0.0F;
float FRONT_LEG_RP_Y_NOTSNEAK = 8.0F;
float FRONT_LEG_RP_Y_SNEAK = 7.0F;
float HEAD_CENTRE_X = 0.0F;
float HEAD_CENTRE_Y = -1.0F;
float HEAD_CENTRE_Z = -2.0F;
float HEAD_RP_X = 0.0F;
float HEAD_RP_Y = 0.0F;
float HEAD_RP_Z = 0.0F;
float LEFT_WING_EXT_RP_X = 4.5F;
float LEFT_WING_EXT_RP_Y = 5.0F;
float LEFT_WING_EXT_RP_Z = 6.0F;
float LEFT_WING_ROTATE_ANGLE_Z_SNEAK = -6.0F;
float LEFT_WING_RP_Y_NOTSNEAK = 5.5F;
float LEFT_WING_RP_Y_SNEAK = 10.5F;
float LEFT_WING_RP_Z_NOTSNEAK = 3.0F;
float LEFT_WING_RP_Z_SNEAK = 2.0F;
float RIDING_SHIFT_Y = -10.0F;
float RIDING_SHIFT_Z = -10.0F;
float RIGHT_WING_EXT_RP_X = -4.5F;
float RIGHT_WING_EXT_RP_Y = 5.0F;
float RIGHT_WING_EXT_RP_Z = 6.0F;
float RIGHT_WING_ROTATE_ANGLE_Z_SNEAK = 6.0F;
float RIGHT_WING_RP_Y_NOTSNEAK = 6.5F;
float RIGHT_WING_RP_Y_SNEAK = 11.5F;
float RIGHT_WING_RP_Z_NOTSNEAK = 3.0F;
float RIGHT_WING_RP_Z_SNEAK = 2.0F;
float ROTATE_270 = 4.712F;
float ROTATE_90 = 1.571F;
float SNEAK_LEG_X_ROTATION_ADJUSTMENT = 0.4F;
float TAIL_RP_X = 0.0F;
float TAIL_RP_Y = 0.8F;
float TAIL_RP_Z = 0.0F;
float TAIL_RP_Z_NOTSNEAK = 14.0F;
float TAIL_RP_Z_SNEAK = 10.0F;
float THIRDP_ARM_CENTRE_X = 0.0F;
float THIRDP_ARM_CENTRE_Y = 10.0F;
float THIRDP_ARM_CENTRE_Z = 0.0F;
float WING_FOLDED_RP_Y = 13.0F;
float WING_FOLDED_RP_Z = -3.0F;
float NECK_ROT_X = 0.166F;
}

View file

@ -1,85 +0,0 @@
package com.brohoof.minelittlepony.model;
import com.brohoof.minelittlepony.renderer.ScalableModelRenderer;
import net.minecraft.client.model.PositionTextureVertex;
import net.minecraft.client.model.TexturedQuad;
import net.minecraft.client.renderer.Tessellator;
public class ScalableModelBox {
private PositionTextureVertex[] vertexPositions;
private TexturedQuad[] quadList;
public final float posX1;
public final float posY1;
public final float posZ1;
public final float posX2;
public final float posY2;
public final float posZ2;
public String field_78247_g;
public ScalableModelBox(ScalableModelRenderer par1ModelRenderer, int par2, int par3, float par4, float par5, float par6, int par7, int par8, int par9, float par10) {
this.posX1 = par4;
this.posY1 = par5;
this.posZ1 = par6;
this.posX2 = par4 + par7;
this.posY2 = par5 + par8;
this.posZ2 = par6 + par9;
this.vertexPositions = new PositionTextureVertex[8];
this.quadList = new TexturedQuad[6];
float var11 = par4 + par7;
float var12 = par5 + par8;
float var13 = par6 + par9;
par4 -= par10;
par5 -= par10;
par6 -= par10;
var11 += par10;
var12 += par10;
var13 += par10;
if(par1ModelRenderer.mirror) {
float var23 = var11;
var11 = par4;
par4 = var23;
}
PositionTextureVertex var231 = new PositionTextureVertex(par4, par5, par6, 0.0F, 0.0F);
PositionTextureVertex var15 = new PositionTextureVertex(var11, par5, par6, 0.0F, 8.0F);
PositionTextureVertex var16 = new PositionTextureVertex(var11, var12, par6, 8.0F, 8.0F);
PositionTextureVertex var17 = new PositionTextureVertex(par4, var12, par6, 8.0F, 0.0F);
PositionTextureVertex var18 = new PositionTextureVertex(par4, par5, var13, 0.0F, 0.0F);
PositionTextureVertex var19 = new PositionTextureVertex(var11, par5, var13, 0.0F, 8.0F);
PositionTextureVertex var20 = new PositionTextureVertex(var11, var12, var13, 8.0F, 8.0F);
PositionTextureVertex var21 = new PositionTextureVertex(par4, var12, var13, 8.0F, 0.0F);
this.vertexPositions[0] = var231;
this.vertexPositions[1] = var15;
this.vertexPositions[2] = var16;
this.vertexPositions[3] = var17;
this.vertexPositions[4] = var18;
this.vertexPositions[5] = var19;
this.vertexPositions[6] = var20;
this.vertexPositions[7] = var21;
this.quadList[0] = new TexturedQuad(new PositionTextureVertex[]{var19, var15, var16, var20}, par2 + par9 + par7, par3 + par9, par2 + par9 + par7 + par9, par3 + par9 + par8, par1ModelRenderer.textureWidth, par1ModelRenderer.textureHeight);
this.quadList[1] = new TexturedQuad(new PositionTextureVertex[]{var231, var18, var21, var17}, par2, par3 + par9, par2 + par9, par3 + par9 + par8, par1ModelRenderer.textureWidth, par1ModelRenderer.textureHeight);
this.quadList[2] = new TexturedQuad(new PositionTextureVertex[]{var19, var18, var231, var15}, par2 + par9, par3, par2 + par9 + par7, par3 + par9, par1ModelRenderer.textureWidth, par1ModelRenderer.textureHeight);
this.quadList[3] = new TexturedQuad(new PositionTextureVertex[]{var16, var17, var21, var20}, par2 + par9 + par7, par3 + par9, par2 + par9 + par7 + par7, par3, par1ModelRenderer.textureWidth, par1ModelRenderer.textureHeight);
this.quadList[4] = new TexturedQuad(new PositionTextureVertex[]{var15, var231, var17, var16}, par2 + par9, par3 + par9, par2 + par9 + par7, par3 + par9 + par8, par1ModelRenderer.textureWidth, par1ModelRenderer.textureHeight);
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, par1ModelRenderer.textureWidth, par1ModelRenderer.textureHeight);
if(par1ModelRenderer.mirror) {
for (TexturedQuad element : this.quadList) {
element.flipFace();
}
}
}
public void render(Tessellator par1Tessellator, float par2) {
for (TexturedQuad element : this.quadList) {
element.draw(par1Tessellator.getWorldRenderer(), par2);
}
}
public ScalableModelBox func_78244_a(String par1Str) {
this.field_78247_g = par1Str;
return this;
}
}

View file

@ -0,0 +1,56 @@
package com.brohoof.minelittlepony.model.part;
import com.brohoof.minelittlepony.PonyData;
import com.brohoof.minelittlepony.model.BodyPart;
import com.brohoof.minelittlepony.model.ModelPony;
import com.brohoof.minelittlepony.renderer.AniParams;
public abstract class AbstractHeadPart implements IPonyPart {
private ModelPony pony;
@Override
public void init(ModelPony pony, float yOffset, float stretch) {
this.pony = pony;
}
@Override
public void render(PonyData data, float scale) {
pony.transform(BodyPart.HEAD);
}
@Override
public final void animate(PonyData data, AniParams ani) {
rotateHead(ani.horz, ani.vert);
if (pony.isSneak && !pony.isFlying) {
position(0, 6, -2);
} else {
position(0, 0, 0);
}
}
private void rotateHead(float horz, float vert) {
float y;
float x;
if (pony.isSleeping) {
y = 1.4F;
x = 0.1F;
} else {
y = horz / (float) (180 / Math.PI);
x = vert / (float) (180 / Math.PI);
}
x = Math.min(x, 0.5F);
x = Math.max(x, -0.5F);
rotate(x, y);
}
protected ModelPony getPony() {
return pony;
}
protected abstract void position(float posX, float posY, float posZ);
protected abstract void rotate(float rotX, float rotY);
}

View file

@ -0,0 +1,15 @@
package com.brohoof.minelittlepony.model.part;
import com.brohoof.minelittlepony.PonyData;
import com.brohoof.minelittlepony.model.ModelPony;
import com.brohoof.minelittlepony.renderer.AniParams;
public interface IPonyPart {
void init(ModelPony pony, float yOffset, float stretch);
void animate(PonyData data, AniParams ani);
void render(PonyData data, float scale);
}

View file

@ -0,0 +1,228 @@
package com.brohoof.minelittlepony.model.part;
import com.brohoof.minelittlepony.PonyData;
import com.brohoof.minelittlepony.model.BodyPart;
import com.brohoof.minelittlepony.model.ModelPony;
import com.brohoof.minelittlepony.model.PonyModelConstants;
import com.brohoof.minelittlepony.renderer.AniParams;
import com.brohoof.minelittlepony.renderer.CompressiveRendering;
import net.minecraft.client.model.ModelRenderer;
import net.minecraft.util.MathHelper;
public class PegasusWings implements IPonyPart, PonyModelConstants {
private ModelPony pony;
public ModelRenderer[] leftWing;
public ModelRenderer[] rightWing;
public ModelRenderer[] leftWingExt;
public ModelRenderer[] rightWingExt;
public CompressiveRendering compressiveLeftWing;
public CompressiveRendering compressiveRightWing;
@Override
public void init(ModelPony pony, float yOffset, float stretch) {
this.pony = pony;
this.leftWing = new ModelRenderer[3];
this.rightWing = new ModelRenderer[3];
this.leftWingExt = new ModelRenderer[6];
this.rightWingExt = new ModelRenderer[6];
this.compressiveLeftWing = new CompressiveRendering(pony);
this.compressiveRightWing = new CompressiveRendering(pony);
for (int i = 0; i < leftWing.length; i++) {
this.leftWing[i] = new ModelRenderer(pony, 56, 16);
this.leftWing[i].mirror = true;
this.compressiveLeftWing.addCompressed(this.leftWing[i]);
}
for (int i = 0; i < rightWing.length; i++) {
this.rightWing[i] = new ModelRenderer(pony, 56, 16);
this.compressiveRightWing.addCompressed(this.rightWing[i]);
}
for (int i = 0; i < leftWingExt.length; i++) {
this.leftWingExt[i] = new ModelRenderer(pony, 56, 19);
this.leftWingExt[i].mirror = true;
this.compressiveLeftWing.addExpanded(this.leftWingExt[i]);
}
for (int i = 0; i < rightWingExt.length; i++) {
this.rightWingExt[i] = new ModelRenderer(pony, 56, 19);
this.compressiveRightWing.addExpanded(this.rightWingExt[i]);
}
this.compressiveLeftWing.setChance(2);
this.compressiveRightWing.setChance(2);
initPositions(yOffset, stretch);
}
private void initPositions(float yOffset, float stretch) {
this.leftWing[0].addBox(4.0F, 5.0F, 2.0F, 2, 6, 2, stretch);
this.leftWing[0].setRotationPoint(HEAD_RP_X, WING_FOLDED_RP_Y + yOffset, WING_FOLDED_RP_Z);
this.leftWing[0].rotateAngleX = ROTATE_90;
this.leftWing[1].addBox(4.0F, 5.0F, 4.0F, 2, 8, 2, stretch);
this.leftWing[1].setRotationPoint(HEAD_RP_X, WING_FOLDED_RP_Y + yOffset, WING_FOLDED_RP_Z);
this.leftWing[1].rotateAngleX = ROTATE_90;
this.leftWing[2].addBox(4.0F, 5.0F, 6.0F, 2, 6, 2, stretch);
this.leftWing[2].setRotationPoint(HEAD_RP_X, WING_FOLDED_RP_Y + yOffset, WING_FOLDED_RP_Z);
this.leftWing[2].rotateAngleX = ROTATE_90;
this.rightWing[0].addBox(-6.0F, 5.0F, 2.0F, 2, 6, 2, stretch);
this.rightWing[0].setRotationPoint(HEAD_RP_X, WING_FOLDED_RP_Y + yOffset, WING_FOLDED_RP_Z);
this.rightWing[0].rotateAngleX = ROTATE_90;
this.rightWing[1].addBox(-6.0F, 5.0F, 4.0F, 2, 8, 2, stretch);
this.rightWing[1].setRotationPoint(HEAD_RP_X, WING_FOLDED_RP_Y + yOffset, WING_FOLDED_RP_Z);
this.rightWing[1].rotateAngleX = ROTATE_90;
this.rightWing[2].addBox(-6.0F, 5.0F, 6.0F, 2, 6, 2, stretch);
this.rightWing[2].setRotationPoint(HEAD_RP_X, WING_FOLDED_RP_Y + yOffset, WING_FOLDED_RP_Z);
this.rightWing[2].rotateAngleX = ROTATE_90;
this.leftWingExt[0].addBox(0.0F, 6.0F, 0.0F, 1, 8, 2, stretch + 0.1F);
this.leftWingExt[0].setRotationPoint(LEFT_WING_EXT_RP_X, LEFT_WING_EXT_RP_Y + yOffset, LEFT_WING_EXT_RP_Z);
this.leftWingExt[1].addBox(0.0F, -1.2F, -0.2F, 1, 8, 2, stretch - 0.2F);
this.leftWingExt[1].setRotationPoint(LEFT_WING_EXT_RP_X, LEFT_WING_EXT_RP_Y + yOffset, LEFT_WING_EXT_RP_Z);
this.leftWingExt[2].addBox(0.0F, 1.8F, 1.3F, 1, 8, 2, stretch - 0.1F);
this.leftWingExt[2].setRotationPoint(LEFT_WING_EXT_RP_X, LEFT_WING_EXT_RP_Y + yOffset, LEFT_WING_EXT_RP_Z);
this.leftWingExt[3].addBox(0.0F, 5.0F, 2.0F, 1, 8, 2, stretch);
this.leftWingExt[3].setRotationPoint(LEFT_WING_EXT_RP_X, LEFT_WING_EXT_RP_Y + yOffset, LEFT_WING_EXT_RP_Z);
this.leftWingExt[4].addBox(0.0F, 0.0F, -0.2F, 1, 6, 2, stretch + 0.3F);
this.leftWingExt[4].setRotationPoint(LEFT_WING_EXT_RP_X, LEFT_WING_EXT_RP_Y + yOffset, LEFT_WING_EXT_RP_Z);
this.leftWingExt[5].addBox(0.0F, 0.0F, 0.2F, 1, 3, 2, stretch + 0.2F);
this.leftWingExt[5].setRotationPoint(LEFT_WING_EXT_RP_X, LEFT_WING_EXT_RP_Y + yOffset, LEFT_WING_EXT_RP_Z);
this.rightWingExt[0].addBox(0.0F, 6.0F, 0.0F, 1, 8, 2, stretch + 0.1F);
this.rightWingExt[0].setRotationPoint(RIGHT_WING_EXT_RP_X, RIGHT_WING_EXT_RP_Y + yOffset, RIGHT_WING_EXT_RP_Z);
this.rightWingExt[1].addBox(0.0F, -1.2F, -0.2F, 1, 8, 2, stretch - 0.2F);
this.rightWingExt[1].setRotationPoint(RIGHT_WING_EXT_RP_X, RIGHT_WING_EXT_RP_Y + yOffset, RIGHT_WING_EXT_RP_Z);
this.rightWingExt[2].addBox(0.0F, 1.8F, 1.3F, 1, 8, 2, stretch - 0.1F);
this.rightWingExt[2].setRotationPoint(RIGHT_WING_EXT_RP_X, RIGHT_WING_EXT_RP_Y + yOffset, RIGHT_WING_EXT_RP_Z);
this.rightWingExt[3].addBox(0.0F, 5.0F, 2.0F, 1, 8, 2, stretch);
this.rightWingExt[3].setRotationPoint(RIGHT_WING_EXT_RP_X, RIGHT_WING_EXT_RP_Y + yOffset, RIGHT_WING_EXT_RP_Z);
this.rightWingExt[4].addBox(0.0F, 0.0F, -0.2F, 1, 6, 2, stretch + 0.3F);
this.rightWingExt[4].setRotationPoint(RIGHT_WING_EXT_RP_X, RIGHT_WING_EXT_RP_Y + yOffset, RIGHT_WING_EXT_RP_Z);
this.rightWingExt[5].addBox(0.0F, 0.0F, 0.2F, 1, 3, 2, stretch + 0.2F);
this.rightWingExt[5].setRotationPoint(RIGHT_WING_EXT_RP_X, RIGHT_WING_EXT_RP_Y + yOffset, RIGHT_WING_EXT_RP_Z);
}
@Override
public void animate(PonyData metadata, AniParams ani) {
float bodySwingRotation = 0.0F;
if (pony.swingProgress > -9990.0F && (!metadata.getRace().hasHorn() || metadata.getGlowColor() == 0)) {
bodySwingRotation = MathHelper.sin(MathHelper.sqrt_float(pony.swingProgress) * 3.1415927F * 2.0F) * 0.2F;
}
for (int i = 0; i < this.leftWing.length; ++i) {
this.leftWing[i].rotateAngleY = bodySwingRotation * 0.2F;
}
for (int i = 0; i < this.rightWing.length; ++i) {
this.rightWing[i].rotateAngleY = bodySwingRotation * 0.2F;
}
if (pony.isSneak && !pony.isFlying) {
this.sneak();
} else if (metadata.getRace().hasWings()) {
this.unsneak(ani.tick);
}
// Special
this.leftWingExt[1].rotateAngleX -= 0.85F;
this.leftWingExt[2].rotateAngleX -= 0.75F;
this.leftWingExt[3].rotateAngleX -= 0.5F;
this.leftWingExt[5].rotateAngleX -= 0.85F;
this.rightWingExt[1].rotateAngleX -= 0.85F;
this.rightWingExt[2].rotateAngleX -= 0.75F;
this.rightWingExt[3].rotateAngleX -= 0.5F;
this.rightWingExt[5].rotateAngleX -= 0.85F;
}
@Override
public void render(PonyData data, float scale) {
pony.transform(BodyPart.BODY);
if (data.getRace() != null && data.getRace().hasWings()) {
if (!pony.isFlying && !pony.isSneak) {
this.setExtendingWings(true);
for (int k1 = 0; k1 < this.leftWing.length; ++k1) {
this.leftWing[k1].render(scale);
}
for (int k1 = 0; k1 < this.rightWing.length; ++k1) {
this.rightWing[k1].render(scale);
}
} else {
this.setExtendingWings(false);
for (int k1 = 0; k1 < this.leftWingExt.length; ++k1) {
this.leftWingExt[k1].render(scale);
}
for (int i = 0; i < this.rightWingExt.length; ++i) {
this.rightWingExt[i].render(scale);
}
}
}
}
private void setExtendingWings(boolean compress) {
this.compressiveLeftWing.setIsCompressed(compress);
this.compressiveRightWing.setIsCompressed(compress);
}
public void setWingCompression(boolean pegasus) {
if (pegasus) {
this.compressiveLeftWing.init_Safe();
this.compressiveRightWing.init_Safe();
} else {
this.compressiveLeftWing.deInit_Safe();
this.compressiveRightWing.deInit_Safe();
}
}
private void sneak() {
for (int i = 0; i < this.leftWingExt.length; ++i) {
this.leftWingExt[i].rotationPointY = LEFT_WING_RP_Y_SNEAK;
this.leftWingExt[i].rotationPointZ = LEFT_WING_RP_Z_SNEAK;
this.leftWingExt[i].rotateAngleX = EXT_WING_ROTATE_ANGLE_X;
this.leftWingExt[i].rotateAngleZ = LEFT_WING_ROTATE_ANGLE_Z_SNEAK;
}
for (int i = 0; i < this.leftWingExt.length; ++i) {
this.rightWingExt[i].rotationPointY = RIGHT_WING_RP_Y_SNEAK;
this.rightWingExt[i].rotationPointZ = RIGHT_WING_RP_Z_SNEAK;
this.rightWingExt[i].rotateAngleX = EXT_WING_ROTATE_ANGLE_X;
this.rightWingExt[i].rotateAngleZ = RIGHT_WING_ROTATE_ANGLE_Z_SNEAK;
}
}
private void unsneak(float tick) {
if (!pony.isFlying) {
for (int i = 0; i < this.leftWing.length; ++i) {
this.leftWing[i].rotationPointY = WING_FOLDED_RP_Y;
this.leftWing[i].rotationPointZ = WING_FOLDED_RP_Z;
}
for (int i = 0; i < this.rightWing.length; ++i) {
this.rightWing[i].rotationPointY = WING_FOLDED_RP_Y;
this.rightWing[i].rotationPointZ = WING_FOLDED_RP_Z;
}
} else {
float WingRotateAngleZ = MathHelper.sin(tick * 0.536F) * 1.0F;
for (int i = 0; i < this.leftWingExt.length; ++i) {
this.leftWingExt[i].rotateAngleX = EXT_WING_ROTATE_ANGLE_X;
this.leftWingExt[i].rotateAngleZ = -WingRotateAngleZ - ROTATE_270 - 0.4F;
this.leftWingExt[i].rotationPointY = LEFT_WING_RP_Y_NOTSNEAK;
this.leftWingExt[i].rotationPointZ = LEFT_WING_RP_Z_NOTSNEAK;
}
for (int i = 0; i < this.rightWingExt.length; ++i) {
this.rightWingExt[i].rotateAngleX = EXT_WING_ROTATE_ANGLE_X;
this.rightWingExt[i].rotateAngleZ = WingRotateAngleZ + ROTATE_270 + 0.4F;
this.rightWingExt[i].rotationPointY = RIGHT_WING_RP_Y_NOTSNEAK;
this.rightWingExt[i].rotationPointZ = RIGHT_WING_RP_Z_NOTSNEAK;
}
}
}
}

View file

@ -0,0 +1,48 @@
package com.brohoof.minelittlepony.model.part;
import com.brohoof.minelittlepony.PonyData;
import com.brohoof.minelittlepony.model.ModelPony;
import com.brohoof.minelittlepony.model.PonyModelConstants;
import net.minecraft.client.model.ModelRenderer;
public class PonyEars extends AbstractHeadPart implements PonyModelConstants {
private ModelRenderer left;
private ModelRenderer right;
@Override
public void init(ModelPony pony, float yOffset, float stretch) {
super.init(pony, yOffset, stretch);
this.left = new ModelRenderer(pony, 12, 16);
this.right = new ModelRenderer(pony, 12, 16);
this.right.mirror = true;
this.left.addBox(-4.0F + HEAD_CENTRE_X, -6.0F + HEAD_CENTRE_Y, 1.0F + HEAD_CENTRE_Z, 2, 2, 2, stretch);
this.left.setRotationPoint(HEAD_RP_X, HEAD_RP_Y + yOffset, HEAD_RP_Z);
this.right.addBox(2.0F + HEAD_CENTRE_X, -6.0F + HEAD_CENTRE_Y, 1.0F + HEAD_CENTRE_Z, 2, 2, 2, stretch);
this.right.setRotationPoint(HEAD_RP_X, HEAD_RP_Y + yOffset, HEAD_RP_Z);
}
@Override
protected void position(float posX, float posY, float posZ) {
getPony().setRotationPoint(left, posX, posY, posZ);
getPony().setRotationPoint(right, posX, posY, posZ);
}
@Override
protected void rotate(float rotX, float rotY) {
this.left.rotateAngleX = rotX;
this.left.rotateAngleY = rotY;
this.right.rotateAngleX = rotX;
this.right.rotateAngleY = rotY;
}
@Override
public void render(PonyData data, float scale) {
super.render(data, scale);
left.render(scale);
right.render(scale);
}
}

View file

@ -0,0 +1,106 @@
package com.brohoof.minelittlepony.model.part;
import java.util.Map;
import com.brohoof.minelittlepony.MineLittlePony;
import com.brohoof.minelittlepony.PonyData;
import com.brohoof.minelittlepony.PonyGender;
import com.brohoof.minelittlepony.model.ModelPony;
import com.brohoof.minelittlepony.model.PonyModelConstants;
import com.brohoof.minelittlepony.renderer.PlaneRenderer;
import com.google.common.collect.ImmutableMap;
public class PonySnout extends AbstractHeadPart implements PonyModelConstants {
private Map<PonyGender, PlaneRenderer[]> map = ImmutableMap.<PonyGender, PlaneRenderer[]> builder()
.put(PonyGender.MARE, new PlaneRenderer[10])
.put(PonyGender.STALLION, new PlaneRenderer[5])
.build();
@Override
public void init(ModelPony pony, float yOffset, float stretch) {
super.init(pony, yOffset, stretch);
PlaneRenderer[] muzzle = map.get(PonyGender.MARE);
muzzle[0] = new PlaneRenderer(pony, 10, 14);
muzzle[1] = new PlaneRenderer(pony, 11, 13);
muzzle[2] = new PlaneRenderer(pony, 9, 14);
muzzle[3] = new PlaneRenderer(pony, 14, 14);
muzzle[4] = new PlaneRenderer(pony, 11, 12);
muzzle[5] = new PlaneRenderer(pony, 18, 7);
muzzle[6] = new PlaneRenderer(pony, 9, 14);
muzzle[7] = new PlaneRenderer(pony, 14, 14);
muzzle[8] = new PlaneRenderer(pony, 11, 12);
muzzle[9] = new PlaneRenderer(pony, 12, 12);
muzzle[0].addBackPlane(-2.0F + HEAD_CENTRE_X, 2.0F + HEAD_CENTRE_Y, -5.0F + HEAD_CENTRE_Z, 4, 2, 0, stretch);
muzzle[0].setRotationPoint(HEAD_RP_X, HEAD_RP_Y + yOffset, HEAD_RP_Z);
muzzle[1].addBackPlane(-1.0F + HEAD_CENTRE_X, 1.0F + HEAD_CENTRE_Y, -5.0F + HEAD_CENTRE_Z, 2, 1, 0, stretch);
muzzle[1].setRotationPoint(HEAD_RP_X, HEAD_RP_Y + yOffset, HEAD_RP_Z);
muzzle[2].addTopPlane(-2.0F + HEAD_CENTRE_X, 2.0F + HEAD_CENTRE_Y, -5.0F + HEAD_CENTRE_Z, 1, 0, 1, stretch);
muzzle[2].setRotationPoint(HEAD_RP_X, HEAD_RP_Y + yOffset, HEAD_RP_Z);
muzzle[3].addTopPlane(1.0F + HEAD_CENTRE_X, 2.0F + HEAD_CENTRE_Y, -5.0F + HEAD_CENTRE_Z, 1, 0, 1, stretch);
muzzle[3].setRotationPoint(HEAD_RP_X, HEAD_RP_Y + yOffset, HEAD_RP_Z);
muzzle[4].addTopPlane(-1.0F + HEAD_CENTRE_X, 1.0F + HEAD_CENTRE_Y, -5.0F + HEAD_CENTRE_Z, 2, 0, 1, stretch);
muzzle[4].setRotationPoint(HEAD_RP_X, HEAD_RP_Y + yOffset, HEAD_RP_Z);
muzzle[5].addBottomPlane(-2.0F + HEAD_CENTRE_X, 4.0F + HEAD_CENTRE_Y, -5.0F + HEAD_CENTRE_Z, 4, 0, 1, stretch);
muzzle[5].setRotationPoint(HEAD_RP_X, HEAD_RP_Y + yOffset, HEAD_RP_Z);
muzzle[6].addSidePlane(-2.0F + HEAD_CENTRE_X, 2.0F + HEAD_CENTRE_Y, -5.0F + HEAD_CENTRE_Z, 0, 2, 1, stretch);
muzzle[6].setRotationPoint(HEAD_RP_X, HEAD_RP_Y + yOffset, HEAD_RP_Z);
muzzle[7].addSidePlane(2.0F + HEAD_CENTRE_X, 2.0F + HEAD_CENTRE_Y, -5.0F + HEAD_CENTRE_Z, 0, 2, 1, stretch);
muzzle[7].setRotationPoint(HEAD_RP_X, HEAD_RP_Y + yOffset, HEAD_RP_Z);
muzzle[8].addSidePlane(-1.0F + HEAD_CENTRE_X, 1.0F + HEAD_CENTRE_Y, -5.0F + HEAD_CENTRE_Z, 0, 1, 1, stretch);
muzzle[8].setRotationPoint(HEAD_RP_X, HEAD_RP_Y + yOffset, HEAD_RP_Z);
muzzle[9].addSidePlane(1.0F + HEAD_CENTRE_X, 1.0F + HEAD_CENTRE_Y, -5.0F + HEAD_CENTRE_Z, 0, 1, 1, stretch);
muzzle[9].setRotationPoint(HEAD_RP_X, HEAD_RP_Y + yOffset, HEAD_RP_Z);
muzzle = map.get(PonyGender.STALLION);
muzzle[0] = new PlaneRenderer(pony, 10, 13);
muzzle[1] = new PlaneRenderer(pony, 10, 13);
muzzle[2] = new PlaneRenderer(pony, 18, 7);
muzzle[3] = new PlaneRenderer(pony, 10, 13);
muzzle[4] = new PlaneRenderer(pony, 13, 13);
muzzle[0].addBackPlane(-2.0F + HEAD_CENTRE_X, 1.0F + HEAD_CENTRE_Y, -5.0F + HEAD_CENTRE_Z, 4, 3, 0, stretch);
muzzle[0].setRotationPoint(HEAD_RP_X, HEAD_RP_Y + yOffset, HEAD_RP_Z);
muzzle[1].addTopPlane(-2.0F + HEAD_CENTRE_X, 1.0F + HEAD_CENTRE_Y, -5.0F + HEAD_CENTRE_Z, 4, 0, 1, stretch);
muzzle[1].setRotationPoint(HEAD_RP_X, HEAD_RP_Y + yOffset, HEAD_RP_Z);
muzzle[2].addBottomPlane(-2.0F + HEAD_CENTRE_X, 4.0F + HEAD_CENTRE_Y, -5.0F + HEAD_CENTRE_Z, 4, 0, 1, stretch);
muzzle[2].setRotationPoint(HEAD_RP_X, HEAD_RP_Y + yOffset, HEAD_RP_Z);
muzzle[3].addSidePlane(-2.0F + HEAD_CENTRE_X, 1.0F + HEAD_CENTRE_Y, -5.0F + HEAD_CENTRE_Z, 0, 3, 1, stretch);
muzzle[3].setRotationPoint(HEAD_RP_X, HEAD_RP_Y + yOffset, HEAD_RP_Z);
muzzle[4].addSidePlane(2.0F + HEAD_CENTRE_X, 1.0F + HEAD_CENTRE_Y, -5.0F + HEAD_CENTRE_Z, 0, 3, 1, stretch);
muzzle[4].setRotationPoint(HEAD_RP_X, HEAD_RP_Y + yOffset, HEAD_RP_Z);
}
@Override
public void render(PonyData data, float scale) {
super.render(data, scale);
if (MineLittlePony.getConfig().getSnuzzles().get() && data.getGender() != null) {
PlaneRenderer[] muzzle = map.get(data.getGender());
for (int i = 0; i < muzzle.length; i++) {
muzzle[i].render(scale);
}
}
}
@Override
protected void position(float posX, float posY, float posZ) {
for (PlaneRenderer[] pr : map.values()) {
for (PlaneRenderer p : pr) {
getPony().setRotationPoint(p, posX, posY, posZ);
}
}
}
@Override
protected void rotate(float rotX, float rotY) {
for (PlaneRenderer[] pr : map.values()) {
for (PlaneRenderer p : pr) {
p.rotateAngleX = rotX;
p.rotateAngleY = rotY;
}
}
}
}

View file

@ -0,0 +1,85 @@
package com.brohoof.minelittlepony.model.part;
import static net.minecraft.client.renderer.GlStateManager.*;
import org.lwjgl.opengl.GL11;
import com.brohoof.minelittlepony.PonyData;
import com.brohoof.minelittlepony.model.ModelPony;
import com.brohoof.minelittlepony.model.PonyModelConstants;
import com.brohoof.minelittlepony.renderer.HornGlowRenderer;
import net.minecraft.client.model.ModelRenderer;
public class UnicornHorn extends AbstractHeadPart implements PonyModelConstants {
private ModelRenderer horn;
private HornGlowRenderer[] hornglow;
@Override
public void init(ModelPony pony, float yOffset, float stretch) {
super.init(pony, yOffset, stretch);
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.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[0].setRotationPoint(HEAD_RP_X, HEAD_RP_Y + yOffset, HEAD_RP_Z);
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);
this.hornglow[1].setRotationPoint(HEAD_RP_X, HEAD_RP_Y + yOffset, HEAD_RP_Z);
}
@Override
public void render(PonyData data, float scale) {
super.render(data, scale);
if (data.getRace() != null && data.getRace().hasHorn()) {
this.horn.render(scale);
if (getPony().heldItemRight != 0 && data.getGlowColor() != 0) {
GL11.glPushAttrib(24577);
disableTexture2D();
disableLighting();
enableBlend();
float var4 = (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, 1);
color(var4, green, blue, 0.4F);
this.hornglow[0].render(scale);
color(var4, green, blue, 0.2F);
this.hornglow[1].render(scale);
enableTexture2D();
enableLighting();
disableBlend();
popAttrib();
}
}
}
protected void position(float posX, float posY, float posZ) {
getPony().setRotationPoint(this.horn, posX, posY, posZ);
for (int i = 0; i < this.hornglow.length; i++) {
getPony().setRotationPoint(this.hornglow[i], posX, posY, posZ);
}
}
protected void rotate(float rotX, float rotY) {
this.horn.rotateAngleX = rotX + 0.5F;
this.horn.rotateAngleY = rotY;
for (int i = 0; i < this.hornglow.length; i++) {
this.hornglow[i].rotateAngleX = rotX + 0.5F;
this.hornglow[i].rotateAngleY = rotY;
}
}
}

View file

@ -1,5 +1,6 @@
package com.brohoof.minelittlepony.model.pony.armor;
import com.brohoof.minelittlepony.model.part.PonyEars;
import com.brohoof.minelittlepony.model.pony.pm_newPonyAdv;
import com.brohoof.minelittlepony.renderer.AniParams;
@ -18,6 +19,11 @@ public class pm_newPonyArmor extends pm_newPonyAdv {
this.textureHeight = 32;
}
@Override
protected void addParts() {
modelParts.add(new PonyEars());
}
@Override
public void animate(AniParams aniparams) {
this.checkRainboom(aniparams.swing);
@ -33,7 +39,7 @@ public class pm_newPonyArmor extends pm_newPonyAdv {
this.setLegs(aniparams.move, aniparams.swing, aniparams.tick);
this.holdItem();
this.swingItem(this.swingProgress);
if (this.issneak && !this.isFlying) {
if (this.isSneak && !this.isFlying) {
this.adjustBody(BODY_ROTATE_ANGLE_X_SNEAK, BODY_RP_Y_SNEAK, BODY_RP_Z_SNEAK);
this.sneakLegs();
this.setHead(0.0F, 6.0F, -2.0F);

View file

@ -1,236 +1,53 @@
package com.brohoof.minelittlepony.renderer;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import net.minecraft.client.model.ModelBase;
import net.minecraft.client.model.TextureOffset;
import net.minecraft.client.renderer.GLAllocation;
import net.minecraft.client.renderer.Tessellator;
import org.lwjgl.opengl.GL11;
import com.brohoof.minelittlepony.model.ModelHornGlow;
public class HornGlowRenderer {
public float textureWidth;
public float textureHeight;
import net.minecraft.client.model.ModelBase;
import net.minecraft.client.model.ModelRenderer;
import net.minecraft.client.model.TextureOffset;
public class HornGlowRenderer extends ModelRenderer {
private int textureOffsetX;
private int textureOffsetY;
public float rotationPointX;
public float rotationPointY;
public float rotationPointZ;
public float rotateAngleX;
public float rotateAngleY;
public float rotateAngleZ;
private boolean compiled;
private int displayList;
public boolean mirror;
public boolean showModel;
public boolean isHidden;
public List<ModelHornGlow> cubeList;
public List<HornGlowRenderer> childModels;
public final String boxName;
private ModelBase baseModel;
public HornGlowRenderer(ModelBase par1ModelBase, String par2Str) {
this.textureWidth = 64.0F;
this.textureHeight = 32.0F;
this.compiled = false;
this.displayList = 0;
this.mirror = false;
this.showModel = true;
this.isHidden = false;
this.cubeList = new ArrayList<ModelHornGlow>();
super(par1ModelBase, par2Str);
this.baseModel = par1ModelBase;
this.boxName = par2Str;
this.setTextureSize(par1ModelBase.textureWidth, par1ModelBase.textureHeight);
}
public HornGlowRenderer(ModelBase par1ModelBase) {
this(par1ModelBase, (String) null);
this(par1ModelBase, null);
}
public HornGlowRenderer(ModelBase par1ModelBase, int par2, int par3) {
this(par1ModelBase);
this.setTextureOffset(par2, par3);
}
this.setTextureSize(par2, par3);
public void addChild(HornGlowRenderer par1ModelRenderer) {
if (this.childModels == null) {
this.childModels = new ArrayList<HornGlowRenderer>();
}
this.childModels.add(par1ModelRenderer);
}
public HornGlowRenderer setTextureOffset(int par1, int par2) {
this.textureOffsetX = par1;
this.textureOffsetY = par2;
return this;
}
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)).func_78244_a(par1Str));
this.cubeList.add((new ModelHornGlow(this, this.textureOffsetX, this.textureOffsetY, par2, par3, par4, par5, par6, par7, 0.0F)).setBoxName(par1Str));
return this;
}
public HornGlowRenderer addBox(float par1, float par2, float par3, int par4, int par5, int par6) {
this.cubeList.add(new ModelHornGlow(this, this.textureOffsetX, this.textureOffsetY, par1, par2, par3, par4,
par5, par6, 0.0F));
this.cubeList.add(new ModelHornGlow(this, this.textureOffsetX, this.textureOffsetY, par1, par2, par3, par4, par5, par6, 0.0F));
return this;
}
public void addBox(float par1, float par2, float par3, int par4, int par5, int par6, float par7) {
this.cubeList.add(new ModelHornGlow(this, this.textureOffsetX, this.textureOffsetY, par1, par2, par3, par4,
par5, par6, par7));
this.cubeList.add(new ModelHornGlow(this, this.textureOffsetX, this.textureOffsetY, par1, par2, par3, par4, par5, par6, par7));
}
public void setRotationPoint(float par1, float par2, float par3) {
this.rotationPointX = par1;
this.rotationPointY = par2;
this.rotationPointZ = par3;
}
public void render(float par1) {
if (!this.isHidden && this.showModel) {
if (!this.compiled) {
this.compileDisplayList(par1);
}
Iterator<HornGlowRenderer> var2;
HornGlowRenderer var3;
if (this.rotateAngleX == 0.0F && this.rotateAngleY == 0.0F && this.rotateAngleZ == 0.0F) {
if (this.rotationPointX == 0.0F && this.rotationPointY == 0.0F && this.rotationPointZ == 0.0F) {
GL11.glCallList(this.displayList);
if (this.childModels != null) {
var2 = this.childModels.iterator();
while (var2.hasNext()) {
var3 = var2.next();
var3.render(par1);
}
}
} else {
GL11.glTranslatef(this.rotationPointX * par1, this.rotationPointY * par1,
this.rotationPointZ * par1);
GL11.glCallList(this.displayList);
if (this.childModels != null) {
var2 = this.childModels.iterator();
while (var2.hasNext()) {
var3 = var2.next();
var3.render(par1);
}
}
GL11.glTranslatef(-this.rotationPointX * par1, -this.rotationPointY * par1,
-this.rotationPointZ * par1);
}
} else {
GL11.glPushMatrix();
GL11.glTranslatef(this.rotationPointX * par1, this.rotationPointY * par1, this.rotationPointZ * par1);
if (this.rotateAngleZ != 0.0F) {
GL11.glRotatef(this.rotateAngleZ * 57.295776F, 0.0F, 0.0F, 1.0F);
}
if (this.rotateAngleY != 0.0F) {
GL11.glRotatef(this.rotateAngleY * 57.295776F, 0.0F, 1.0F, 0.0F);
}
if (this.rotateAngleX != 0.0F) {
GL11.glRotatef(this.rotateAngleX * 57.295776F, 1.0F, 0.0F, 0.0F);
}
GL11.glCallList(this.displayList);
if (this.childModels != null) {
var2 = this.childModels.iterator();
while (var2.hasNext()) {
var3 = var2.next();
var3.render(par1);
}
}
GL11.glPopMatrix();
}
}
}
public void renderWithRotation(float par1) {
if (!this.isHidden && this.showModel) {
if (!this.compiled) {
this.compileDisplayList(par1);
}
GL11.glPushMatrix();
GL11.glTranslatef(this.rotationPointX * par1, this.rotationPointY * par1, this.rotationPointZ * par1);
if (this.rotateAngleY != 0.0F) {
GL11.glRotatef(this.rotateAngleY * 57.295776F, 0.0F, 1.0F, 0.0F);
}
if (this.rotateAngleX != 0.0F) {
GL11.glRotatef(this.rotateAngleX * 57.295776F, 1.0F, 0.0F, 0.0F);
}
if (this.rotateAngleZ != 0.0F) {
GL11.glRotatef(this.rotateAngleZ * 57.295776F, 0.0F, 0.0F, 1.0F);
}
GL11.glCallList(this.displayList);
GL11.glPopMatrix();
}
}
public void postRender(float par1) {
if (!this.isHidden && this.showModel) {
if (!this.compiled) {
this.compileDisplayList(par1);
}
if (this.rotateAngleX == 0.0F && this.rotateAngleY == 0.0F && this.rotateAngleZ == 0.0F) {
if (this.rotationPointX != 0.0F || this.rotationPointY != 0.0F || this.rotationPointZ != 0.0F) {
GL11.glTranslatef(this.rotationPointX * par1, this.rotationPointY * par1,
this.rotationPointZ * par1);
}
} else {
GL11.glTranslatef(this.rotationPointX * par1, this.rotationPointY * par1, this.rotationPointZ * par1);
if (this.rotateAngleZ != 0.0F) {
GL11.glRotatef(this.rotateAngleZ * 57.295776F, 0.0F, 0.0F, 1.0F);
}
if (this.rotateAngleY != 0.0F) {
GL11.glRotatef(this.rotateAngleY * 57.295776F, 0.0F, 1.0F, 0.0F);
}
if (this.rotateAngleX != 0.0F) {
GL11.glRotatef(this.rotateAngleX * 57.295776F, 1.0F, 0.0F, 0.0F);
}
}
}
}
private void compileDisplayList(float par1) {
this.displayList = GLAllocation.generateDisplayLists(1);
GL11.glNewList(this.displayList, 4864);
Tessellator var2 = Tessellator.getInstance();
for (ModelHornGlow var4 : cubeList) {
var4.render(var2, par1);
}
GL11.glEndList();
this.compiled = true;
}
public HornGlowRenderer setTextureSize(int par1, int par2) {
this.textureWidth = par1;
this.textureHeight = par2;
@Override
public ModelRenderer setTextureOffset(int x, int y) {
this.textureOffsetX = x;
this.textureOffsetY = y;
return this;
}
}

View file

@ -58,26 +58,19 @@ public abstract class RenderPony extends RendererLivingEntity implements IRender
thePony.checkSkin();
this.playerModel = this.getModel(player);
this.mainModel = this.playerModel.getModel();
this.playerModel.getArmor().modelArmorChestplate.heldItemRight = this.playerModel.getArmor().modelArmor.heldItemRight = this.playerModel
.getModel().heldItemRight = currentItemStack == null ? 0 : 1;
this.playerModel.getModel().heldItemRight = currentItemStack == null ? 0 : 1;
this.playerModel.apply(thePony.metadata);
if (currentItemStack != null && player.getItemInUseCount() > 0) {
EnumAction yOrigin = currentItemStack.getItemUseAction();
if (yOrigin == EnumAction.BLOCK) {
this.playerModel.getArmor().modelArmorChestplate.heldItemRight = this.playerModel.getArmor().modelArmor.heldItemRight = this.playerModel
.getModel().heldItemRight = 3;
this.playerModel.getModel().heldItemRight = 3;
} else if (yOrigin == EnumAction.BOW) {
this.playerModel.getArmor().modelArmorChestplate.aimedBow = this.playerModel.getArmor().modelArmor.aimedBow = this.playerModel
.getModel().aimedBow = true;
this.playerModel.getModel().aimedBow = true;
}
}
this.playerModel.getArmor().modelArmorChestplate.issneak = this.playerModel.getArmor().modelArmor.issneak = this.playerModel.getModel().issneak = player
.isSneaking();
this.playerModel
.getArmor().modelArmorChestplate.isFlying = this.playerModel.getArmor().modelArmor.isFlying = this.playerModel.getModel().isFlying = thePony
.isPegasusFlying(player);
// , this.renderManager.worldObj);
this.playerModel.getModel().isSneak = player.isSneaking();
this.playerModel.getModel().isFlying = thePony.isPegasusFlying(player);
if (MineLittlePony.getConfig().getShowScale().get()) {
if (this.playerModel != PMAPI.human) {
@ -102,20 +95,15 @@ public abstract class RenderPony extends RendererLivingEntity implements IRender
yOrigin1 -= 0.125D;
}
this.playerModel.getArmor().modelArmorChestplate.isSleeping = this.playerModel.getArmor().modelArmor.isSleeping = this.playerModel
.getModel().isSleeping = player.isPlayerSleeping();
this.playerModel.getArmor().modelArmorChestplate.swingProgress = this.playerModel.getArmor().modelArmor.swingProgress = this.playerModel
.getModel().swingProgress;
this.playerModel.getArmor().modelArmorChestplate.isVillager = this.playerModel.getArmor().modelArmor.isVillager = this.playerModel
.getModel().isVillager = false;
this.playerModel.getModel().isSleeping = player.isPlayerSleeping();
this.playerModel.getModel().swingProgress = getSwingProgress(player, partialTicks);
this.playerModel.getModel().isVillager = false;
super.doRender(player, x, yOrigin1, z, yaw, partialTicks);
this.playerModel
.getArmor().modelArmorChestplate.aimedBow = this.playerModel.getArmor().modelArmor.aimedBow = this.playerModel.getModel().aimedBow = false;
this.playerModel.getArmor().modelArmorChestplate.issneak = this.playerModel.getArmor().modelArmor.issneak = this.playerModel.getModel().issneak = false;
this.playerModel.getArmor().modelArmorChestplate.heldItemRight = this.playerModel.getArmor().modelArmor.heldItemRight = this.playerModel
.getModel().heldItemRight = 0;
this.playerModel.getModel().aimedBow = false;
this.playerModel.getModel().isSneak = false;
this.playerModel.getModel().heldItemRight = 0;
}
@AppendInsns("renderLivingAt")

View file

@ -6,7 +6,6 @@ import com.brohoof.minelittlepony.PonyRace;
import com.brohoof.minelittlepony.TailLengths;
import com.brohoof.minelittlepony.model.ModelPony;
import com.brohoof.minelittlepony.model.PlayerModel;
import com.brohoof.minelittlepony.model.pony.pm_newPonyAdv;
import com.brohoof.minelittlepony.renderer.layer.LayerHeldPonyItem;
import com.brohoof.minelittlepony.renderer.layer.LayerPonyArmor;
import com.brohoof.minelittlepony.renderer.layer.LayerPonySkull;
@ -40,46 +39,38 @@ public abstract class RenderPonyMob<T extends EntityLiving> extends RenderLiving
public void doRender(EntityLiving entity, double xPosition, double yPosition, double zPosition, float yaw,
float partialTicks) {
ItemStack heldItem = entity.getHeldItem();
this.playerModel.getArmor().modelArmorChestplate.heldItemRight = this.playerModel.getArmor().modelArmor.heldItemRight = this.playerModel
.getModel().heldItemRight = heldItem == null
? 0 : 1;
this.playerModel.getModel().heldItemRight = heldItem == null ? 0 : 1;
this.playerModel.getArmor().modelArmorChestplate.issneak = this.playerModel.getArmor().modelArmor.issneak = this.playerModel.getModel().issneak = false;
this.playerModel
.getArmor().modelArmorChestplate.isFlying = this.playerModel.getArmor().modelArmor.isFlying = this.playerModel.getModel().isFlying = false;
if (this.playerModel.getModel() instanceof pm_newPonyAdv) {
((pm_newPonyAdv) this.playerModel.getModel()).setHasWings_Compression(false);
}
this.playerModel.getModel().isSneak = false;
this.playerModel.getModel().isFlying = false;
if (entity instanceof EntitySkeleton) {
switch (entity.getEntityId() % 3) {
switch (entity.getUniqueID().hashCode() % 3) {
case 0:
case 1:
this.playerModel.getArmor().modelArmor.metadata.setRace(PonyRace.UNICORN);
this.playerModel.getModel().metadata.setRace(PonyRace.UNICORN);
break;
case 2:
this.playerModel.getArmor().modelArmor.metadata.setRace(PonyRace.EARTH);
this.playerModel.getModel().metadata.setRace(PonyRace.EARTH);
}
} else {
this.playerModel.getArmor().modelArmor.metadata.setRace(PonyRace.EARTH);
this.playerModel.getModel().metadata.setRace(PonyRace.EARTH);
}
if (entity instanceof EntityPigZombie) {
this.playerModel.getArmor().modelArmor.metadata.setGender(PonyGender.STALLION);
this.playerModel.getModel().metadata.setGender(PonyGender.STALLION);
} else {
this.playerModel.getArmor().modelArmor.metadata.setGender(PonyGender.MARE);
this.playerModel.getModel().metadata.setGender(PonyGender.MARE);
}
if (entity instanceof EntitySkeleton) {
this.playerModel.getModel().metadata.setTail(TailLengths.FULL);
} else {
this.playerModel.getModel().metadata.setTail(TailLengths.STUB);
} else {
this.playerModel.getModel().metadata.setTail(TailLengths.FULL);
}
this.playerModel.getArmor().modelArmorChestplate.isSleeping = this.playerModel.getArmor().modelArmor.isSleeping = this.playerModel
.getModel().isSleeping = false;
this.playerModel.getModel().isSleeping = false;
if (MineLittlePony.getConfig().getShowScale().get()) {
this.shadowSize = 0.4F;
}
@ -90,11 +81,9 @@ public abstract class RenderPonyMob<T extends EntityLiving> extends RenderLiving
}
super.doRender(entity, xPosition, yOrigin, zPosition, yaw, partialTicks);
this.playerModel
.getArmor().modelArmorChestplate.aimedBow = this.playerModel.getArmor().modelArmor.aimedBow = this.playerModel.getModel().aimedBow = false;
this.playerModel.getArmor().modelArmorChestplate.issneak = this.playerModel.getArmor().modelArmor.issneak = this.playerModel.getModel().issneak = false;
this.playerModel.getArmor().modelArmorChestplate.heldItemRight = this.playerModel.getArmor().modelArmor.heldItemRight = this.playerModel
.getModel().heldItemRight = 0;
this.playerModel.getModel().aimedBow = false;
this.playerModel.getModel().isSneak = false;
this.playerModel.getModel().heldItemRight = 0;
}
@SuppressWarnings("unchecked")

View file

@ -1,10 +1,9 @@
package com.brohoof.minelittlepony.renderer;
import org.lwjgl.opengl.GL11;
import com.brohoof.minelittlepony.PonyManager;
import com.brohoof.minelittlepony.model.PMAPI;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.renderer.entity.RenderManager;
import net.minecraft.client.renderer.entity.layers.LayerBipedArmor;
import net.minecraft.entity.EntityLivingBase;
@ -26,7 +25,7 @@ public class RenderPonySkeleton extends RenderPonyMob<EntitySkeleton> {
@Override
protected void preRenderCallback(EntitySkeleton skeleton, float partialTicks) {
if (skeleton.getSkeletonType() == 1) {
GL11.glScalef(1.2F, 1.2F, 1.2F);
GlStateManager.scale(1.2F, 1.2F, 1.2F);
}
}
@ -37,7 +36,6 @@ public class RenderPonySkeleton extends RenderPonyMob<EntitySkeleton> {
@Override
protected ResourceLocation getEntityTexture(EntitySkeleton skeleton) {
return skeleton.getSkeletonType() == 1 ? PonyManager.WITHER_SKELETON
: PonyManager.SKELETON;
return skeleton.getSkeletonType() == 1 ? PonyManager.WITHER_SKELETON : PonyManager.SKELETON;
}
}

View file

@ -1,11 +1,10 @@
package com.brohoof.minelittlepony.renderer;
import org.lwjgl.opengl.GL11;
import com.brohoof.minelittlepony.MineLittlePony;
import com.brohoof.minelittlepony.Pony;
import com.brohoof.minelittlepony.model.PMAPI;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.renderer.entity.RenderManager;
import net.minecraft.entity.passive.EntityVillager;
import net.minecraft.util.ResourceLocation;
@ -28,7 +27,7 @@ public class RenderPonyVillager extends RenderPonyMob<EntityVillager> {
}
}
GL11.glScalef(0.9375F, 0.9375F, 0.9375F);
GlStateManager.scale(0.9375F, 0.9375F, 0.9375F);
}
@Override

View file

@ -1,313 +0,0 @@
package com.brohoof.minelittlepony.renderer;
import java.util.ArrayList;
import java.util.List;
import org.lwjgl.opengl.GL11;
import com.brohoof.minelittlepony.model.ScalableModelBox;
import net.minecraft.client.model.ModelBase;
import net.minecraft.client.model.ModelRenderer;
import net.minecraft.client.model.TextureOffset;
import net.minecraft.client.renderer.GLAllocation;
import net.minecraft.client.renderer.Tessellator;
public class ScalableModelRenderer extends ModelRenderer {
public float textureWidth;
public float textureHeight;
private int textureOffsetX;
private int textureOffsetY;
public float rotationPointX;
public float rotationPointY;
public float rotationPointZ;
public float rotateAngleX;
public float rotateAngleY;
public float rotateAngleZ;
private boolean compiled;
private int displayList;
public boolean mirror;
public boolean showModel;
public boolean isHidden;
public List<ScalableModelBox> cubeList;
public List<ScalableModelRenderer> childModels;
public final String boxName;
private ModelBase baseModel;
public float offsetX;
public float offsetY;
public float offsetZ;
@SuppressWarnings("unchecked")
public ScalableModelRenderer(ModelBase par1ModelBase, String par2Str) {
super(par1ModelBase);
this.textureWidth = 64.0F;
this.textureHeight = 32.0F;
this.showModel = true;
this.cubeList = new ArrayList<ScalableModelBox>();
this.baseModel = par1ModelBase;
par1ModelBase.boxList.add(this);
this.boxName = par2Str;
this.setTextureSize(par1ModelBase.textureWidth, par1ModelBase.textureHeight);
}
public ScalableModelRenderer(ModelBase par1ModelBase) {
this(par1ModelBase, (String) null);
}
public ScalableModelRenderer(ModelBase par1ModelBase, int par2, int par3) {
this(par1ModelBase);
this.setTextureOffset(par2, par3);
}
public void addChild(ScalableModelRenderer par1ModelRenderer) {
if (this.childModels == null) {
this.childModels = new ArrayList<ScalableModelRenderer>();
}
this.childModels.add(par1ModelRenderer);
}
@Override
public ScalableModelRenderer setTextureOffset(int par1, int par2) {
this.textureOffsetX = par1;
this.textureOffsetY = par2;
return this;
}
@Override
public ScalableModelRenderer 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 ScalableModelBox(this, this.textureOffsetX, this.textureOffsetY, par2, par3, par4, par5,
par6, par7, 0.0F)).func_78244_a(par1Str));
return this;
}
@Override
public ScalableModelRenderer addBox(float par1, float par2, float par3, int par4, int par5, int par6) {
this.cubeList.add(new ScalableModelBox(this, this.textureOffsetX, this.textureOffsetY, par1, par2, par3, par4,
par5, par6, 0.0F));
return this;
}
@Override
public void addBox(float par1, float par2, float par3, int par4, int par5, int par6, float par7) {
this.cubeList.add(new ScalableModelBox(this, this.textureOffsetX, this.textureOffsetY, par1, par2, par3, par4,
par5, par6, par7));
}
@Override
public void setRotationPoint(float par1, float par2, float par3) {
this.rotationPointX = par1;
this.rotationPointY = par2;
this.rotationPointZ = par3;
}
@Override
public void render(float par1) {
if (!this.isHidden && this.showModel) {
if (!this.compiled) {
this.compileDisplayList(par1);
}
GL11.glTranslatef(this.offsetX, this.offsetY, this.offsetZ);
int var2;
if (this.rotateAngleX == 0.0F && this.rotateAngleY == 0.0F && this.rotateAngleZ == 0.0F) {
if (this.rotationPointX == 0.0F && this.rotationPointY == 0.0F && this.rotationPointZ == 0.0F) {
GL11.glCallList(this.displayList);
if (this.childModels != null) {
for (var2 = 0; var2 < this.childModels.size(); ++var2) {
this.childModels.get(var2).render(par1);
}
}
} else {
GL11.glTranslatef(this.rotationPointX * par1, this.rotationPointY * par1,
this.rotationPointZ * par1);
GL11.glCallList(this.displayList);
if (this.childModels != null) {
for (var2 = 0; var2 < this.childModels.size(); ++var2) {
this.childModels.get(var2).render(par1);
}
}
GL11.glTranslatef(-this.rotationPointX * par1, -this.rotationPointY * par1,
-this.rotationPointZ * par1);
}
} else {
GL11.glPushMatrix();
GL11.glTranslatef(this.rotationPointX * par1, this.rotationPointY * par1, this.rotationPointZ * par1);
if (this.rotateAngleZ != 0.0F) {
GL11.glRotatef(this.rotateAngleZ * 57.295776F, 0.0F, 0.0F, 1.0F);
}
if (this.rotateAngleY != 0.0F) {
GL11.glRotatef(this.rotateAngleY * 57.295776F, 0.0F, 1.0F, 0.0F);
}
if (this.rotateAngleX != 0.0F) {
GL11.glRotatef(this.rotateAngleX * 57.295776F, 1.0F, 0.0F, 0.0F);
}
GL11.glCallList(this.displayList);
if (this.childModels != null) {
for (var2 = 0; var2 < this.childModels.size(); ++var2) {
this.childModels.get(var2).render(par1);
}
}
GL11.glPopMatrix();
}
GL11.glTranslatef(-this.offsetX, -this.offsetY, -this.offsetZ);
}
}
public void render(float par1, float scaleX, float scaleY, float scaleZ) {
if (!this.isHidden && this.showModel) {
if (!this.compiled) {
this.compileDisplayList(par1);
}
GL11.glTranslatef(this.offsetX, this.offsetY, this.offsetZ);
int var2;
if (this.rotateAngleX == 0.0F && this.rotateAngleY == 0.0F && this.rotateAngleZ == 0.0F) {
if (this.rotationPointX == 0.0F && this.rotationPointY == 0.0F && this.rotationPointZ == 0.0F) {
GL11.glPushMatrix();
GL11.glScalef(scaleX, scaleY, scaleZ);
GL11.glCallList(this.displayList);
if (this.childModels != null) {
for (var2 = 0; var2 < this.childModels.size(); ++var2) {
this.childModels.get(var2).render(par1);
}
}
GL11.glPopMatrix();
} else {
GL11.glTranslatef(this.rotationPointX * par1, this.rotationPointY * par1,
this.rotationPointZ * par1);
GL11.glPushMatrix();
GL11.glScalef(scaleX, scaleY, scaleZ);
GL11.glCallList(this.displayList);
if (this.childModels != null) {
for (var2 = 0; var2 < this.childModels.size(); ++var2) {
this.childModels.get(var2).render(par1);
}
}
GL11.glPopMatrix();
GL11.glTranslatef(-this.rotationPointX * par1, -this.rotationPointY * par1,
-this.rotationPointZ * par1);
}
} else {
GL11.glPushMatrix();
GL11.glTranslatef(this.rotationPointX * par1, this.rotationPointY * par1, this.rotationPointZ * par1);
if (this.rotateAngleZ != 0.0F) {
GL11.glRotatef(this.rotateAngleZ * 57.295776F, 0.0F, 0.0F, 1.0F);
}
if (this.rotateAngleY != 0.0F) {
GL11.glRotatef(this.rotateAngleY * 57.295776F, 0.0F, 1.0F, 0.0F);
}
if (this.rotateAngleX != 0.0F) {
GL11.glRotatef(this.rotateAngleX * 57.295776F, 1.0F, 0.0F, 0.0F);
}
GL11.glPushMatrix();
GL11.glScalef(scaleX, scaleY, scaleZ);
GL11.glCallList(this.displayList);
if (this.childModels != null) {
for (var2 = 0; var2 < this.childModels.size(); ++var2) {
this.childModels.get(var2).render(par1);
}
}
GL11.glPopMatrix();
GL11.glPopMatrix();
}
GL11.glTranslatef(-this.offsetX, -this.offsetY, -this.offsetZ);
}
}
@Override
public void renderWithRotation(float par1) {
if (!this.isHidden && this.showModel) {
if (!this.compiled) {
this.compileDisplayList(par1);
}
GL11.glPushMatrix();
GL11.glTranslatef(this.rotationPointX * par1, this.rotationPointY * par1, this.rotationPointZ * par1);
if (this.rotateAngleY != 0.0F) {
GL11.glRotatef(this.rotateAngleY * 57.295776F, 0.0F, 1.0F, 0.0F);
}
if (this.rotateAngleX != 0.0F) {
GL11.glRotatef(this.rotateAngleX * 57.295776F, 1.0F, 0.0F, 0.0F);
}
if (this.rotateAngleZ != 0.0F) {
GL11.glRotatef(this.rotateAngleZ * 57.295776F, 0.0F, 0.0F, 1.0F);
}
GL11.glCallList(this.displayList);
GL11.glPopMatrix();
}
}
@Override
public void postRender(float par1) {
if (!this.isHidden && this.showModel) {
if (!this.compiled) {
this.compileDisplayList(par1);
}
if (this.rotateAngleX == 0.0F && this.rotateAngleY == 0.0F && this.rotateAngleZ == 0.0F) {
if (this.rotationPointX != 0.0F || this.rotationPointY != 0.0F || this.rotationPointZ != 0.0F) {
GL11.glTranslatef(this.rotationPointX * par1, this.rotationPointY * par1,
this.rotationPointZ * par1);
}
} else {
GL11.glTranslatef(this.rotationPointX * par1, this.rotationPointY * par1, this.rotationPointZ * par1);
if (this.rotateAngleZ != 0.0F) {
GL11.glRotatef(this.rotateAngleZ * 57.295776F, 0.0F, 0.0F, 1.0F);
}
if (this.rotateAngleY != 0.0F) {
GL11.glRotatef(this.rotateAngleY * 57.295776F, 0.0F, 1.0F, 0.0F);
}
if (this.rotateAngleX != 0.0F) {
GL11.glRotatef(this.rotateAngleX * 57.295776F, 1.0F, 0.0F, 0.0F);
}
}
}
}
private void compileDisplayList(float par1) {
this.displayList = GLAllocation.generateDisplayLists(1);
GL11.glNewList(this.displayList, 4864);
Tessellator var2 = Tessellator.getInstance();
for (int var3 = 0; var3 < this.cubeList.size(); ++var3) {
this.cubeList.get(var3).render(var2, par1);
}
GL11.glEndList();
this.compiled = true;
}
@Override
public ScalableModelRenderer setTextureSize(int par1, int par2) {
this.textureWidth = par1;
this.textureHeight = par2;
return this;
}
}

View file

@ -63,7 +63,7 @@ public class LayerPonyArmor implements LayerRenderer {
boolean isLegs = armorSlot == 3;
ModelPony modelbase = isLegs ? pony.getArmor().modelArmorChestplate : pony.getArmor().modelArmor;
modelbase.setModelAttributes(this.renderer.getMainModel());
modelbase.setModelAttributes(this.pony.getModel());
modelbase.setLivingAnimations(entitylivingbaseIn, p_177141_2_, p_177141_3_, partialTicks);
modelbase = getArmorModel(entitylivingbaseIn, itemstack, armorSlot, modelbase);
prepareToRender((pm_newPonyArmor) modelbase, armorSlot);

View file

@ -48,18 +48,18 @@ public class LayerPonyCape implements LayerRenderer {
} 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) {
if (model.getModel().isSneak && !model.getModel().isFlying) {
translate(0.0F, 0.03F, 0.0F);
}
} else if (model.getModel().metadata.getSize() == PonySize.PRINCESS) {
translate(0.0F, -0.09F, 0.0F);
scale(1.0F, 1.0F, 1.0F);
if (model.getModel().issneak && !model.getModel().isFlying) {
if (model.getModel().isSneak && !model.getModel().isFlying) {
translate(0.0F, 0.03F, 0.0F);
}
}
if (model.getModel().issneak && !model.getModel().isFlying) {
if (model.getModel().isSneak && !model.getModel().isFlying) {
translate(0.0F, 0.4F, -0.12F);
}
double d = clientPlayer.prevChasingPosX + (clientPlayer.chasingPosX - clientPlayer.prevChasingPosX) * scale

View file

@ -1,17 +0,0 @@
package com.brohoof.minelittlepony.util;
import com.mumfrey.liteloader.core.runtime.Obf;
public class MineLPObf extends Obf {
public static final MineLPObf isJumping = new MineLPObf("field_70703_bu", "aW", "isJumping");
public static final MineLPObf ARMOR_TEXTURE_RES_MAP = new MineLPObf("field_177191_j", "j", "ARMOR_TEXTURE_RES_MAP");
protected MineLPObf(String seargeName, String obfName, String mcpName) {
super(seargeName, obfName, mcpName);
}
protected MineLPObf(String seargeName, String obfName) {
super(seargeName, obfName, seargeName);
}
}

View file

@ -1,22 +0,0 @@
package com.brohoof.minelittlepony.util;
import java.util.Map;
import com.mumfrey.liteloader.core.runtime.Obf;
import com.mumfrey.liteloader.util.PrivateFields;
import net.minecraft.client.renderer.entity.layers.LayerArmorBase;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.util.ResourceLocation;
public class MineLPPrivateFields<P, T> extends PrivateFields<P, T> {
public static final MineLPPrivateFields<EntityLivingBase, Boolean> isJumping = new MineLPPrivateFields<EntityLivingBase, Boolean>(
EntityLivingBase.class, MineLPObf.isJumping);
public static final MineLPPrivateFields<LayerArmorBase, Map<String, ResourceLocation>> ARMOR_TEXTURE_RES_MAP = new MineLPPrivateFields<LayerArmorBase, Map<String, ResourceLocation>>(
LayerArmorBase.class, MineLPObf.ARMOR_TEXTURE_RES_MAP);
protected MineLPPrivateFields(Class<P> owner, Obf obf) {
super(owner, obf);
}
}

View file

@ -1,207 +0,0 @@
package com.brohoof.minelittlepony.util;
import java.lang.reflect.Constructor;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import com.brohoof.minelittlepony.util.MineLPLogger;
import com.brohoof.minelittlepony.util.MineLPReflection;
public class MineLPRData {
public boolean installed = false;
public boolean compatible = false;
public HashMap<String, Class<?>> classes = new HashMap<String, Class<?>>();
public HashMap<String, Constructor<?>> constructors = new HashMap<String, Constructor<?>>();
public HashMap<String, Method> methods = new HashMap<String, Method>();
public HashMap<String, Field> fields = new HashMap<String, Field>();
public HashMap<String, Object> objects = new HashMap<String, Object>();
public Object getInstance(String constructorName, Object... params) {
try {
if (this.constructors.containsKey(constructorName)) {
Constructor<?> e = this.constructors.get(constructorName);
if (params != null && params.length != 0) {
return e.newInstance(params);
}
return e.newInstance();
}
MineLPLogger.error("Unknown requested constructor \"%s\"", constructorName);
} catch (Exception var4) {
var4.printStackTrace();
MineLPLogger.error("Error when trying to get constructor \"%s\"", constructorName);
}
return null;
}
public boolean isInstance(String className, Object object) {
return this.getClass(className).isInstance(object);
}
public Object getField(String fieldName, Object object) {
try {
if (this.fields.containsKey(fieldName)) {
Field e = this.fields.get(fieldName);
return e.get(object);
}
MineLPLogger.error("Unknown requested field \"%s\"", fieldName);
} catch (Exception var4) {
var4.printStackTrace();
MineLPLogger.error("Error when trying to get field \"%s\"", fieldName);
}
return null;
}
public boolean setField(String fieldName, Object object, Object value) {
try {
if (this.fields.containsKey(fieldName)) {
Field e = this.fields.get(fieldName);
e.set(object, value);
return true;
}
MineLPLogger.error("Unknown requested field \"%s\"", fieldName);
return false;
} catch (Exception var5) {
var5.printStackTrace();
MineLPLogger.error("Error when trying to set field \"%s\"", fieldName);
return false;
}
}
public Object invokeMethod(String methodName, Object object, Object... params) {
try {
if (this.methods.containsKey(methodName)) {
Method e = this.methods.get(methodName);
return params != null ? e.invoke(object, params) : e.invoke(object);
}
MineLPLogger.error("Unknown requested method \"%s\"", methodName);
return null;
} catch (Exception var5) {
var5.printStackTrace();
MineLPLogger.error("Method \"%s\" failed to be invoked", methodName);
MineLPLogger.error("Types: " + MineLPReflection.getStringFromTypes(MineLPReflection.getTypesFromObjects(params)));
MineLPLogger.error("Values: " + params);
return null;
}
}
public Class<?> getClass(String className) {
return this.classes.containsKey(className) ? this.classes.get(className) : null;
}
public Constructor<?> getConstructor(String constructorName) {
return this.constructors.containsKey(constructorName) ? this.constructors.get(constructorName) : null;
}
public Method getMethod(String methodName) {
return this.methods.containsKey(methodName) ? this.methods.get(methodName) : null;
}
public Field getField(String fieldName) {
return this.fields.containsKey(fieldName) ? this.fields.get(fieldName) : null;
}
public Object getObject(String objectName) {
Object object = null;
if (this.objects.containsKey(objectName)) {
object = this.objects.get(objectName);
}
if (object == null) {
MineLPLogger.error("Object \"%s\" is NULL", objectName);
}
return object;
}
public void putClass(String className, Class<?> clazz) {
this.classes.put(className, clazz);
}
public void putConstructor(String constructorName, Constructor<?> constructor) {
this.constructors.put(constructorName, constructor);
}
public void putMethod(String methodName, Method method) {
this.methods.put(methodName, method);
}
public void putField(String fieldName, Field field) {
this.fields.put(fieldName, field);
}
public void putObject(String objectName, Object object) {
this.objects.put(objectName, object);
}
public void removeClass(String className) {
this.classes.remove(className);
}
public void removeConstructor(String constructorName) {
this.constructors.remove(constructorName);
}
public void removeMethod(String methodName) {
this.methods.remove(methodName);
}
public void removeField(String fieldName) {
this.fields.remove(fieldName);
}
public void removeObject(String objectName) {
this.objects.remove(objectName);
}
public boolean hasClass(String className) {
return this.classes.containsKey(className);
}
public boolean hasConstructor(String constructorName) {
return this.constructors.containsKey(constructorName);
}
public boolean hasMethod(String methodName) {
return this.methods.containsKey(methodName);
}
public boolean hasField(String fieldName) {
return this.fields.containsKey(fieldName);
}
public boolean hasObject(String objectName) {
return this.objects.containsKey(objectName);
}
public boolean removeNullData() {
boolean nullDataPresent = false;
nullDataPresent |= this.removeNullData(this.classes);
nullDataPresent |= this.removeNullData(this.constructors);
nullDataPresent |= this.removeNullData(this.methods);
nullDataPresent |= this.removeNullData(this.fields);
return nullDataPresent;
}
private <K> boolean removeNullData(Map<K, ?> map) {
// boolean nullDataPresent = false;
Iterator<K> var3 = map.keySet().iterator();
while (var3.hasNext()) {
Object key = var3.next();
if (map.get(key) == null) {
this.constructors.remove(key);
// nullDataPresent = true;
}
}
return false;
}
}

View file

@ -1,318 +0,0 @@
package com.brohoof.minelittlepony.util;
import java.lang.reflect.Constructor;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
import com.brohoof.minelittlepony.util.MineLPLogger;
import com.brohoof.minelittlepony.util.MineLPRData;
import net.minecraft.client.Minecraft;
import net.minecraft.client.model.ModelBiped;
import net.minecraft.client.renderer.RenderGlobal;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.entity.RenderBiped;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.MovingObjectPosition;
// TODO Don't use reflection during rendering
public class MineLPReflection {
public static MineLPRData forgeAPI;
public static void preCall() {}
private static boolean reflectForgeAPI(MineLPRData data) {
MineLPLogger.info("Checking ForgeAPI...");
final String frgPkg = "net.minecraftforge.client.";
Class<?> ItemRenderType = getClass(frgPkg + "IItemRenderer$ItemRenderType");
Class<?> ItemRendererHelper = getClass(frgPkg + "IItemRenderer$ItemRendererHelper");
Class<?> IItemRenderer = getClass(frgPkg + "IItemRenderer");
Class<?> MinecraftForgeClient = getClass(frgPkg + "MinecraftForgeClient");
Class<?> ForgeHooksClient = getClass(frgPkg + "ForgeHooksClient");
Class<?>[] reflectedForgeAPIClasses = new Class[] {
ItemRenderType,
ItemRendererHelper,
IItemRenderer,
MinecraftForgeClient,
ForgeHooksClient,
RenderBiped.class
};
data.installed = false;
int var9 = reflectedForgeAPIClasses.length;
byte o = 0;
if (o < var9) {
Class<?> enumConstants = reflectedForgeAPIClasses[o];
if (enumConstants == null) {
return false;
}
data.installed = true;
}
data.putClass("ForgeHooksClient", ForgeHooksClient);
data.putClass("IItemRenderer", IItemRenderer);
data.putClass("MinecraftForgeClient", MinecraftForgeClient);
data.putClass("IItemRenderer$ItemRenderType", ItemRenderType);
data.putClass("IItemRenderer$ItemRendererHelper", ItemRendererHelper);
Method m;
data.putMethod("ForgeHooksClient.getArmorModel", m = getMethod(ForgeHooksClient, "getArmorModel", EntityLivingBase.class, ItemStack.class, Integer.TYPE, ModelBiped.class));
if (m == null) {
return false;
}
MineLPLogger.debug("ForgeAPI Method " + stringMethod(m));
data.putMethod("ForgeHooksClient.getArmorTexture",
m = getMethod(ForgeHooksClient, "getArmorTexture", Entity.class, ItemStack.class, String.class, Integer.TYPE, String.class));
if (m == null) {
return false;
}
MineLPLogger.debug("ForgeAPI Method " + stringMethod(m));
data.putMethod("ForgeHooksClient.orientBedCamera", m = getMethod(ForgeHooksClient, "orientBedCamera", Minecraft.class, EntityLivingBase.class));
if (m == null) {
return false;
}
MineLPLogger.debug("ForgeAPI Method " + stringMethod(m));
data.putMethod("ForgeHooksClient.setRenderPass", m = getMethod(ForgeHooksClient, "setRenderPass", Integer.TYPE));
if (m == null) {
return false;
}
MineLPLogger.debug("ForgeAPI Method " + stringMethod(m));
data.putMethod("ForgeHooksClient.onDrawBlockHighlight", m = getMethod(ForgeHooksClient, "onDrawBlockHighlight",
RenderGlobal.class, EntityPlayer.class, MovingObjectPosition.class, Integer.TYPE, ItemStack.class, Float.TYPE));
if (m == null) {
return false;
}
MineLPLogger.debug("ForgeAPI Method " + stringMethod(m));
data.putMethod("ForgeHooksClient.dispatchRenderLast", m = getMethod(ForgeHooksClient, "dispatchRenderLast", RenderGlobal.class, Float.TYPE));
if (m == null) {
return false;
}
MineLPLogger.debug("ForgeAPI Method " + stringMethod(m));
data.putMethod("MinecraftForgeClient.getItemRenderer",
m = getMethod(MinecraftForgeClient, "getItemRenderer", ItemStack.class, ItemRenderType));
if (m == null) {
return false;
}
MineLPLogger.debug("ForgeAPI Method " + stringMethod(m));
data.putMethod("IItemRenderer.shouldUseRenderHelper",
m = getMethod(IItemRenderer, "shouldUseRenderHelper", ItemRenderType, ItemStack.class, ItemRendererHelper));
if (m == null) {
return false;
}
MineLPLogger.debug("ForgeAPI Method " + stringMethod(m));
data.putMethod("Item.getRenderPasses", m = getMethod(Item.class, "getRenderPasses", Integer.TYPE));
if (m == null) {
return false;
}
MineLPLogger.debug("ForgeAPI Method " + stringMethod(m));
data.putMethod("RenderBiped.getArmorResource",
m = getMethod(RenderBiped.class, "getArmorResource", Entity.class, ItemStack.class, Integer.TYPE, String.class));
if (m == null) {
return false;
}
MineLPLogger.debug("ForgeAPI Method " + stringMethod(m));
data.putMethod("Entity.canRiderInteract", m = getMethod(Entity.class, "canRiderInteract", new Class[0]));
if (m == null) {
return false;
}
MineLPLogger.debug("ForgeAPI Method " + stringMethod(m));
data.putMethod("RenderGlobal.drawBlockDamageTexture",
m = getMethod(RenderGlobal.class, "drawBlockDamageTexture", Tessellator.class, EntityLivingBase.class, Float.TYPE));
if (m == null) {
return false;
}
MineLPLogger.debug("ForgeAPI Method " + stringMethod(m));
Object[] enumConstants1 = ItemRenderType.getEnumConstants();
Object o1;
data.putObject("IItemRenderer$ItemRenderType.ENTITY", o1 = enumConstants1[0]);
if (o1 == null) {
return false;
}
MineLPLogger.debug("ForgeAPI Object " + o1.toString());
data.putObject("IItemRenderer$ItemRenderType.EQUIPPED", o1 = enumConstants1[1]);
if (o1 == null) {
return false;
}
MineLPLogger.debug("ForgeAPI Object " + o1.toString());
data.putObject("IItemRenderer$ItemRenderType.EQUIPPED_FIRST_PERSON", o1 = enumConstants1[2]);
if (o1 == null) {
return false;
}
MineLPLogger.debug("ForgeAPI Object " + o1.toString());
data.putObject("IItemRenderer$ItemRenderType.INVENTORY", o1 = enumConstants1[3]);
if (o1 == null) {
return false;
}
MineLPLogger.debug("ForgeAPI Object " + o1.toString());
data.putObject("IItemRenderer$ItemRenderType.FIRST_PERSON_MAP", o1 = enumConstants1[4]);
if (o1 == null) {
return false;
}
MineLPLogger.debug("ForgeAPI Object " + o1.toString());
enumConstants1 = ItemRendererHelper.getEnumConstants();
data.putObject("IItemRenderer$ItemRendererHelper.ENTITY_ROTATION", o1 = enumConstants1[0]);
if (o1 == null) {
return false;
}
MineLPLogger.debug("ForgeAPI Object " + o1.toString());
data.putObject("IItemRenderer$ItemRendererHelper.ENTITY_BOBBING", o1 = enumConstants1[1]);
if (o1 == null) {
return false;
}
MineLPLogger.debug("ForgeAPI Object " + o1.toString());
data.putObject("IItemRenderer$ItemRendererHelper.EQUIPPED_BLOCK", o1 = enumConstants1[2]);
if (o1 == null) {
return false;
}
MineLPLogger.debug("ForgeAPI Object " + o1.toString());
data.putObject("IItemRenderer$ItemRendererHelper.BLOCK_3D", o1 = enumConstants1[3]);
if (o1 == null) {
return false;
}
MineLPLogger.debug("ForgeAPI Object " + o1.toString());
data.putObject("IItemRenderer$ItemRendererHelper.INVENTORY_BLOCK", o1 = enumConstants1[4]);
if (o1 == null) {
return false;
}
MineLPLogger.debug("ForgeAPI Object " + o1.toString());
if (forgeAPI.removeNullData()) {
MineLPLogger.warn("ForgeAPI reflection returned some nulls");
}
return true;
}
public static Class<?> getClass(String className) {
try {
return Class.forName(className);
} catch (Exception var2) {
return null;
}
}
public static Constructor<?> getConstructor(Class<?> clazz, Class<?>... types) {
try {
Constructor<?> e = null;
try {
if (types != null && types.length != 0) {
e = clazz.getConstructor(types);
} else {
e = clazz.getConstructor(new Class[0]);
}
} catch (Exception var4) {
}
return e;
} catch (Exception var5) {
MineLPLogger.error("Failed to match Constructor for class \"%s\"", new Object[] { clazz.getName() });
var5.printStackTrace();
return null;
}
}
public static Field getField(Class<?> clazz, String fieldName) {
try {
Field f = null;
try {
f = clazz.getField(fieldName);
} catch (Exception var5) {
f = null;
}
if (f == null) {
f = clazz.getDeclaredField(fieldName);
}
f.setAccessible(true);
return f;
} catch (Exception e) {
MineLPLogger.error("Failed to match Field \"%s\" in %s", new Object[] { fieldName, clazz.getName() });
e.printStackTrace();
}
return null;
}
public static Method getMethod(Class<?> clazz, String methodName, Class<?>... types) {
try {
Method e = null;
try {
e = clazz.getMethod(methodName, types);
} catch (Exception var5) {
}
if (e == null) {
if (types != null && types.length != 0) {
e = clazz.getDeclaredMethod(methodName, types);
} else {
e = clazz.getDeclaredMethod(methodName, new Class[0]);
}
}
e.setAccessible(true);
return e;
} catch (Exception var6) {
MineLPLogger.error("Failed to match method \"%s\" in %s", new Object[] { methodName, clazz.getName() });
MineLPLogger.error("Types: " + getStringFromTypes(types));
var6.printStackTrace();
return null;
}
}
public static String getStringFromTypes(Class<?>... types) {
String temp = "";
temp = temp + "(";
boolean first = true;
Class<?>[] var3 = types;
int var4 = types.length;
for (int var5 = 0; var5 < var4; ++var5) {
Class<?> c = var3[var5];
if (!first) {
temp = temp + ",";
} else {
first = false;
}
temp = temp + c.getName();
}
temp = temp + ")";
return temp;
}
public static Class<?>[] getTypesFromObjects(Object... objects) {
Class<?>[] types = new Class[objects.length];
for (int i = 0; i < objects.length; ++i) {
types[i] = objects[i].getClass();
}
return types;
}
public static String stringMethod(Method m) {
return Modifier.toString(m.getModifiers()) + " "
+ (m.getReturnType() != null ? m.getReturnType().getName() : "void") + " " + m.getName()
+ getStringFromTypes(m.getParameterTypes())
+ (m.getExceptionTypes().length > 0 ? " throws " + getStringFromTypes(m.getExceptionTypes()) : "");
}
static {
MineLPLogger.info("Checking compatibilities...");
forgeAPI = new MineLPRData();
forgeAPI.compatible = reflectForgeAPI(forgeAPI);
MineLPLogger.info("Compatibility Check Done!");
if (forgeAPI.installed) {
MineLPLogger.info("ForgeAPI " + (forgeAPI.compatible ? "Installed and Compatible" : "Installed but Incompatible"));
}
}
}