Skip to content

Commit

Permalink
v1.9
Browse files Browse the repository at this point in the history
  • Loading branch information
Furgl committed Jun 13, 2016
1 parent 8aa4b2a commit 6b7e050
Show file tree
Hide file tree
Showing 16 changed files with 193 additions and 283 deletions.
6 changes: 3 additions & 3 deletions src/main/java/furgl/babyMobs/client/model/ModelBabyBlaze.java
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package furgl.babyMobs.client.model;

import furgl.babyMobs.common.BabyMobs;
import net.minecraft.client.model.ModelBlaze;
import net.minecraft.client.model.ModelRenderer;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.entity.Entity;
import net.minecraftforge.fml.relauncher.ReflectionHelper;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;

Expand All @@ -18,8 +18,8 @@ public class ModelBabyBlaze extends ModelBlaze
public ModelBabyBlaze()
{
super();
this.blazeSticks = (ModelRenderer[]) BabyMobs.reflect(ModelBlaze.class, "blazeSticks", this);
this.blazeHead = (ModelRenderer) BabyMobs.reflect(ModelBlaze.class, "blazeHead", this);
this.blazeSticks = (ModelRenderer[]) ReflectionHelper.getPrivateValue(ModelBlaze.class, this, 0);
this.blazeHead = (ModelRenderer) ReflectionHelper.getPrivateValue(ModelBlaze.class, this, 1);
}

/**
Expand Down
8 changes: 4 additions & 4 deletions src/main/java/furgl/babyMobs/client/model/ModelBabyGhast.java
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package furgl.babyMobs.client.model;

import furgl.babyMobs.common.BabyMobs;
import net.minecraft.client.model.ModelGhast;
import net.minecraft.client.model.ModelRenderer;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.entity.Entity;
import net.minecraftforge.fml.relauncher.ReflectionHelper;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;

Expand All @@ -16,9 +16,9 @@ public class ModelBabyGhast extends ModelGhast

public ModelBabyGhast()
{
super();
this.body = (ModelRenderer) BabyMobs.reflect(ModelGhast.class, "body", this);
this.tentacles = (ModelRenderer[]) BabyMobs.reflect(ModelGhast.class, "tentacles", this);
super();
this.body = (ModelRenderer) ReflectionHelper.getPrivateValue(ModelGhast.class, this, 0);
this.tentacles = (ModelRenderer[]) ReflectionHelper.getPrivateValue(ModelGhast.class, this, 1);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
package furgl.babyMobs.client.model;

import furgl.babyMobs.common.BabyMobs;
import furgl.babyMobs.common.entity.monster.EntityBabyGuardian;
import net.minecraft.client.model.ModelGuardian;
import net.minecraft.client.model.ModelRenderer;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.entity.Entity;
import net.minecraft.entity.monster.EntityGuardian;
import net.minecraft.util.math.MathHelper;
import net.minecraftforge.fml.relauncher.ReflectionHelper;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;

@SideOnly(Side.CLIENT)
public class ModelBabyGuardian extends ModelGuardian
{
private ModelRenderer guardianBody;
private ModelRenderer guardianBody;
private ModelRenderer[] guardianSpines;

public ModelBabyGuardian()
{
super();
this.guardianBody = (ModelRenderer) BabyMobs.reflect(ModelGuardian.class, "guardianBody", this);
this.guardianBody = (ModelRenderer) ReflectionHelper.getPrivateValue(ModelGuardian.class, this, 0);
this.guardianSpines = new ModelRenderer[12];
for (int i = 0; i < this.guardianSpines.length; ++i)
{
Expand Down
96 changes: 18 additions & 78 deletions src/main/java/furgl/babyMobs/client/model/ModelBabyShulker.java
Original file line number Diff line number Diff line change
@@ -1,104 +1,44 @@
package furgl.babyMobs.client.model;

import furgl.babyMobs.common.entity.monster.EntityBabyShulker;
import net.minecraft.client.model.ModelRenderer;
import net.minecraft.client.model.ModelShulker;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.util.math.MathHelper;
import net.minecraftforge.fml.relauncher.ReflectionHelper;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;

@SideOnly(Side.CLIENT)
public class ModelBabyShulker extends ModelShulker
{
private ModelRenderer field_187067_b; //bottom
private ModelRenderer field_187068_c; //top
public ModelRenderer field_187066_a; //head

public ModelBabyShulker()
{
this.textureHeight = 64;
this.textureWidth = 64;
this.field_187068_c = new ModelRenderer(this);
this.field_187067_b = new ModelRenderer(this);
this.field_187066_a = new ModelRenderer(this);
this.field_187068_c.setTextureOffset(0, 0).addBox(-8.0F, -16.0F, -8.0F, 16, 12, 16);
this.field_187068_c.setRotationPoint(0.0F, 24.0F, 0.0F);
this.field_187067_b.setTextureOffset(0, 28).addBox(-8.0F, -8.0F, -8.0F, 16, 8, 16);
this.field_187067_b.setRotationPoint(0.0F, 24.0F, 0.0F);
this.field_187066_a.setTextureOffset(0, 52).addBox(-3.0F, 0.0F, -3.0F, 6, 6, 6);
this.field_187066_a.setRotationPoint(0.0F, 12.0F, 0.0F);
}

public int func_187065_a()
{
return 28;
}

/**
* Used for easily adding entity-dependent animations. The second and third float params here are the same second
* and third as in the setRotationAngles method.
*/
public void setLivingAnimations(EntityLivingBase entitylivingbaseIn, float p_78086_2_, float p_78086_3_, float partialTickTime)
{
}

/**
* Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms
* and legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how
* "far" arms and legs can swing at most.
*/
public void setRotationAngles(float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scaleFactor, Entity entityIn)
{
EntityBabyShulker entityshulker = (EntityBabyShulker)entityIn;
float f = ageInTicks - (float)entityshulker.ticksExisted;
float f1 = (0.5F + entityshulker.func_184688_a(f)) * (float)Math.PI;
float f2 = -1.0F + MathHelper.sin(f1);
float f3 = 0.0F;

if (f1 > (float)Math.PI)
{
f3 = MathHelper.sin(ageInTicks * 0.1F) * 0.7F;
}

this.field_187068_c.setRotationPoint(0.0F, 16.0F + MathHelper.sin(f1) * 8.0F + f3, 0.0F);

if (entityshulker.func_184688_a(f) > 0.3F)
{
this.field_187068_c.rotateAngleY = f2 * f2 * f2 * f2 * (float)Math.PI * 0.125F;
}
else
{
this.field_187068_c.rotateAngleY = 0.0F;
}

this.field_187066_a.rotateAngleX = headPitch * 0.017453292F;
this.field_187066_a.rotateAngleY = netHeadYaw * 0.017453292F;
}

/**
* Sets the models various rotation angles then renders the model.
*/
public void render(Entity entityIn, float par2, float limbSwing, float ageInTicks, float netHeadYaw, float headPitch, float scale)
{
isChild = true;
private ModelRenderer field_187067_b; //bottom
private ModelRenderer field_187068_c; //top

public ModelBabyShulker()
{
super();
field_187067_b = ReflectionHelper.getPrivateValue(ModelShulker.class, this, 0);
field_187068_c = ReflectionHelper.getPrivateValue(ModelShulker.class, this, 1);
}

public void render(Entity entityIn, float par2, float limbSwing, float ageInTicks, float netHeadYaw, float headPitch, float scale)
{
isChild = true;
this.setRotationAngles(par2, limbSwing, ageInTicks, netHeadYaw, headPitch, scale, entityIn);
GlStateManager.pushMatrix();
float f6 = 2F;
GlStateManager.scale(1.5F / f6, 1.5F / f6, 1.5F / f6);
GlStateManager.translate(0.0F, 16.0F * scale + 0.3F, 0.0F);
GlStateManager.popMatrix();

GlStateManager.popMatrix();
GlStateManager.pushMatrix();
GlStateManager.scale(1.0F / f6, 1.0F / f6, 1.0F / f6);
GlStateManager.translate(0.0F, 24.0F * scale, 0.0F);

this.field_187066_a.render(scale); //head
//this.field_187066_a.render(scale); //head - in RenderBabyShulker
this.field_187067_b.render(scale); //bottom
this.field_187068_c.render(scale); //top

GlStateManager.popMatrix();
}
}
}
60 changes: 30 additions & 30 deletions src/main/java/furgl/babyMobs/client/model/ModelBabySquid.java
Original file line number Diff line number Diff line change
@@ -1,46 +1,46 @@
package furgl.babyMobs.client.model;

import furgl.babyMobs.common.BabyMobs;
import net.minecraft.client.model.ModelRenderer;
import net.minecraft.client.model.ModelSquid;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.entity.Entity;
import net.minecraftforge.fml.relauncher.ReflectionHelper;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;

@SideOnly(Side.CLIENT)
public class ModelBabySquid extends ModelSquid
{
/** The squid's body */
ModelRenderer squidBody;
/** The squid's tentacles */
ModelRenderer[] squidTentacles = new ModelRenderer[8];
public ModelBabySquid()
{
super();
this.squidBody = (ModelRenderer) BabyMobs.reflect(ModelSquid.class, "squidBody", this);
this.squidTentacles = (ModelRenderer[]) BabyMobs.reflect(ModelSquid.class, "squidTentacles", this);
}
@Override
/** The squid's body */
ModelRenderer squidBody;
/** The squid's tentacles */
ModelRenderer[] squidTentacles = new ModelRenderer[8];

public ModelBabySquid()
{
super();
this.squidBody = (ModelRenderer) ReflectionHelper.getPrivateValue(ModelSquid.class, this, 0);
this.squidTentacles = (ModelRenderer[]) ReflectionHelper.getPrivateValue(ModelSquid.class, this, 1);
}

@Override
public void render(Entity p_78088_1_, float p_78088_2_, float p_78088_3_, float p_78088_4_, float p_78088_5_, float p_78088_6_, float p_78088_7_)
{
isChild = true;
{
isChild = true;

float scaleFactor = 0.5F;
GlStateManager.pushMatrix();
GlStateManager.translate(0F, 0F, 0F);
GlStateManager.scale(scaleFactor, scaleFactor, scaleFactor);
this.setRotationAngles(p_78088_2_, p_78088_3_, p_78088_4_, p_78088_5_, p_78088_6_, p_78088_7_, p_78088_1_);
this.squidBody.render(p_78088_7_);

for (int i = 0; i < this.squidTentacles.length; ++i)
{
this.squidTentacles[i].render(p_78088_7_);
}
GlStateManager.popMatrix();
}
GlStateManager.translate(0F, 0F, 0F);
GlStateManager.scale(scaleFactor, scaleFactor, scaleFactor);

this.setRotationAngles(p_78088_2_, p_78088_3_, p_78088_4_, p_78088_5_, p_78088_6_, p_78088_7_, p_78088_1_);
this.squidBody.render(p_78088_7_);

for (int i = 0; i < this.squidTentacles.length; ++i)
{
this.squidTentacles[i].render(p_78088_7_);
}

GlStateManager.popMatrix();
}
}
22 changes: 11 additions & 11 deletions src/main/java/furgl/babyMobs/client/model/ModelBabyWither.java
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
package furgl.babyMobs.client.model;

import furgl.babyMobs.common.BabyMobs;
import net.minecraft.client.model.ModelRenderer;
import net.minecraft.client.model.ModelWither;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraftforge.fml.relauncher.ReflectionHelper;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;

@SideOnly(Side.CLIENT)
public class ModelBabyWither extends ModelWither
{
private ModelRenderer[] pieces;
private ModelRenderer[] heads;
private ModelRenderer[] field_82905_a; //pieces
private ModelRenderer[] field_82904_b; //heads

public ModelBabyWither(float p_i46302_1_)
{
super(p_i46302_1_);
this.pieces = (ModelRenderer[]) BabyMobs.reflect(ModelWither.class, "field_82905_a", this);
this.pieces[0] = new ModelRenderer(this, 0, 16);
this.heads = new ModelRenderer[1];
this.heads[0] = new ModelRenderer(this, 0, 0);
this.heads[0].addBox(-4.0F, -1.0F, -4.0F, 8, 8, 8, p_i46302_1_);
this.field_82905_a = (ModelRenderer[]) ReflectionHelper.getPrivateValue(ModelWither.class, this, 0);
this.field_82905_a[0] = new ModelRenderer(this, 0, 16);
this.field_82904_b = new ModelRenderer[1];
this.field_82904_b[0] = new ModelRenderer(this, 0, 0);
this.field_82904_b[0].addBox(-4.0F, -1.0F, -4.0F, 8, 8, 8, p_i46302_1_);
}

@Override
Expand All @@ -36,7 +36,7 @@ public void render(Entity p_78088_1_, float p_78088_2_, float p_78088_3_, float
GlStateManager.scale(scaleFactor, scaleFactor, scaleFactor);

this.setRotationAngles(p_78088_2_, p_78088_3_, p_78088_4_, p_78088_5_, p_78088_6_, p_78088_7_, p_78088_1_);
ModelRenderer[] amodelrenderer = this.heads;
ModelRenderer[] amodelrenderer = this.field_82904_b;
int i = amodelrenderer.length;
int j;
ModelRenderer modelrenderer;
Expand All @@ -45,7 +45,7 @@ public void render(Entity p_78088_1_, float p_78088_2_, float p_78088_3_, float
modelrenderer = amodelrenderer[j];
modelrenderer.render(p_78088_7_);
}
amodelrenderer = this.pieces;
amodelrenderer = this.field_82905_a;
i = amodelrenderer.length;
for (j = 0; j < i; ++j)
{
Expand All @@ -59,6 +59,6 @@ public void render(Entity p_78088_1_, float p_78088_2_, float p_78088_3_, float
@Override
public void setLivingAnimations(EntityLivingBase p_78086_1_, float p_78086_2_, float p_78086_3_, float p_78086_4_)
{

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import org.lwjgl.opengl.GL11;

import furgl.babyMobs.client.model.ModelBabyEnderman;
import furgl.babyMobs.common.BabyMobs;
import furgl.babyMobs.common.entity.monster.EntityBabyEnderman;
import net.minecraft.client.model.ModelEnderman;
import net.minecraft.client.renderer.GlStateManager;
Expand All @@ -17,6 +16,7 @@
import net.minecraft.entity.monster.EntityEnderman;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.math.Vec3d;
import net.minecraftforge.fml.relauncher.ReflectionHelper;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;

Expand All @@ -29,7 +29,7 @@ public RenderBabyEnderman(RenderManager renderManager)
{
super(renderManager);
this.mainModel = new ModelBabyEnderman(0.0F);
BabyMobs.reflect(RenderEnderman.class, "endermanModel", this, (ModelEnderman) this.mainModel);
ReflectionHelper.setPrivateValue(RenderEnderman.class, this, (ModelEnderman) this.mainModel, 1);
}

@Override
Expand Down
Loading

0 comments on commit 6b7e050

Please sign in to comment.