Jump to content

Custom Creeper Entity doesnt render with my texture


shinymew12

Recommended Posts

So i am trying to update my creeper mod from 1.6.4 to 1.7.10. However the creepers all render with the texture of a normal creeper and i am kind of confused since that never happened to me in 1.6.4 and the only bits of code i changed were necessary to update to 1.7.10. Does any one have any ideas what might be causing this?

 

Here is the code:

Creeper Model Class(pretty much the same as the normal creeper):

 

@SideOnly(Side.CLIENT)

public class CoalCreeper extends ModelBase

{

    public ModelRenderer head;

    public ModelRenderer field_78133_b;

    public ModelRenderer body;

    public ModelRenderer leg1;

    public ModelRenderer leg2;

    public ModelRenderer leg3;

    public ModelRenderer leg4;

 

    public CoalCreeper()

    {

        this(0.0F);

    }

 

    public CoalCreeper(float par1)

    {

        byte b0 = 4;

        this.head = new ModelRenderer(this, 0, 0);

        this.head.addBox(-4.0F, -8.0F, -4.0F, 8, 8, 8, par1);

        this.head.setRotationPoint(0.0F, (float)b0, 0.0F);

        this.field_78133_b = new ModelRenderer(this, 32, 0);

        this.field_78133_b.addBox(-4.0F, -8.0F, -4.0F, 8, 8, 8, par1 + 0.5F);

        this.field_78133_b.setRotationPoint(0.0F, (float)b0, 0.0F);

        this.body = new ModelRenderer(this, 16, 16);

        this.body.addBox(-4.0F, 0.0F, -2.0F, 8, 12, 4, par1);

        this.body.setRotationPoint(0.0F, (float)b0, 0.0F);

        this.leg1 = new ModelRenderer(this, 0, 16);

        this.leg1.addBox(-2.0F, 0.0F, -2.0F, 4, 6, 4, par1);

        this.leg1.setRotationPoint(-2.0F, (float)(12 + b0), 4.0F);

        this.leg2 = new ModelRenderer(this, 0, 16);

        this.leg2.addBox(-2.0F, 0.0F, -2.0F, 4, 6, 4, par1);

        this.leg2.setRotationPoint(2.0F, (float)(12 + b0), 4.0F);

        this.leg3 = new ModelRenderer(this, 0, 16);

        this.leg3.addBox(-2.0F, 0.0F, -2.0F, 4, 6, 4, par1);

        this.leg3.setRotationPoint(-2.0F, (float)(12 + b0), -4.0F);

        this.leg4 = new ModelRenderer(this, 0, 16);

        this.leg4.addBox(-2.0F, 0.0F, -2.0F, 4, 6, 4, par1);

        this.leg4.setRotationPoint(2.0F, (float)(12 + b0), -4.0F);

    }

 

    /**

    * Sets the models various rotation angles then renders the model.

    */

    public void render(Entity par1Entity, float par2, float par3, float par4, float par5, float par6, float par7)

    {

        this.setRotationAngles(par2, par3, par4, par5, par6, par7, par1Entity);

        this.head.render(par7);

        this.body.render(par7);

        this.leg1.render(par7);

        this.leg2.render(par7);

        this.leg3.render(par7);

        this.leg4.render(par7);

    }

 

    /**

    * 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 par1, float par2, float par3, float par4, float par5, float par6, Entity par7Entity)

    {

        this.head.rotateAngleY = par4 / (180F / (float)Math.PI);

        this.head.rotateAngleX = par5 / (180F / (float)Math.PI);

        this.leg1.rotateAngleX = MathHelper.cos(par1 * 0.6662F) * 1.4F * par2;

        this.leg2.rotateAngleX = MathHelper.cos(par1 * 0.6662F + (float)Math.PI) * 1.4F * par2;

        this.leg3.rotateAngleX = MathHelper.cos(par1 * 0.6662F + (float)Math.PI) * 1.4F * par2;

        this.leg4.rotateAngleX = MathHelper.cos(par1 * 0.6662F) * 1.4F * par2;

    }

}

 

 

Here is the Creeper Render Class:

 

 

ublic class CoalCreeperRender extends RenderLiving {

protected CoalCreeper mobModel;

private static final ResourceLocation field_20002_a = new ResourceLocation ("OreCreepers:textures/mobs/CoalCreeper.png");

 

public CoalCreeperRender(ModelBase par1ModelBase, float par2) {

super(par1ModelBase, par2);

mobModel = ((CoalCreeper)mainModel);

 

}

public void CoalCreeperRender(EntityCoalCreeper par1EntityLiving, double par2, double par4, double par6, float par8, float par9) {

super.doRender(par1EntityLiving, par2, par4, par6, par8, par9);

}

public void doRenderLiving(EntityLiving par1EntityLiving, double par2, double par4, double par6, float par8, float par9) {

CoalCreeperRender((EntityCoalCreeper)par1EntityLiving, par2, par4, par6, par8, par9);

}

public void doRender(Entity par1Entity, double par2, double par4, double par6, float par8, float par9) {

CoalCreeperRender((EntityCoalCreeper)par1Entity, par2, par4, par6, par8, par9);

}

 

 

@Override

protected ResourceLocation getEntityTexture(Entity entity) {

return field_20002_a;

}

 

}

 

 

 

The Creeper Entity Class:

 

 

public class EntityCoalCreeper extends EntityCreeper {

 

 

   

   

public EntityCoalCreeper(World par1World) {

super(par1World);

}

public void applyEntityAttributes() {

super.applyEntityAttributes();

this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(40.0D);

this.getEntityAttribute(SharedMonsterAttributes.followRange).setBaseValue(16.0D);

this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.25D);

this.getEntityAttribute(SharedMonsterAttributes.knockbackResistance).setBaseValue(0.2D);

}

private int explosionRadius = 4;

 

public boolean getCanSpawnHere()

    {

        return this.worldObj.difficultySetting != EnumDifficulty.PEACEFUL && this.isValidLightLevel() && super.getCanSpawnHere();

    }

 

protected String getHurtSound()

    {

        return "mob.creeper.say";

    }

 

protected String getDeathSound()

    {

        return "mob.creeper.death";

    }

 

protected void dropFewItems(boolean par1, int par2)

    {

        int j = this.rand.nextInt(7 + par2) + 0;

 

        for (int k = 0; k < j; ++k)

        {

            this.entityDropItem(new ItemStack(Items.coal), 0.0F);

        }

    }

 

}

 

 

 

The Client Proxy:

 

 

public class ClientProxy extends CommonProxy {

 

public void registerRenderThings() {

RenderingRegistry.registerEntityRenderingHandler(EntityCoalCreeper.class, new CoalCreeperRender(new CoalCreeper(), 0.8F));

RenderingRegistry.registerEntityRenderingHandler(EntityRedstoneCreeper.class, new RedstoneCreeperRender(new RedstoneCreeper(), 0.8F));

RenderingRegistry.registerEntityRenderingHandler(EntityIronCreeper.class, new IronCreeperRender(new IronCreeper(), 0.8F));

RenderingRegistry.registerEntityRenderingHandler(EntityGoldCreeper.class, new GoldCreeperRender(new GoldCreeper(), 0.8F));

RenderingRegistry.registerEntityRenderingHandler(EntityLapisCreeper.class, new LapisCreeperRender(new LapisCreeper(), 0.8F));

RenderingRegistry.registerEntityRenderingHandler(EntityDiamondCreeper.class, new DiamondCreeperRender(new DiamondCreeper(), 0.8F));

RenderingRegistry.registerEntityRenderingHandler(EntityEmeraldCreeper.class, new EmeraldCreeperRender(new EmeraldCreeper(), 0.8F));

RenderingRegistry.registerEntityRenderingHandler(EntityNetherQuartzCreeper.class, new NetherQuartzCreeperRender(new NetherQuartzCreeper(), 0.8F));

}

}

 

 

 

From the main class:

 

 

EntityRegistry.registerGlobalEntityID(EntityCoalCreeper.class, "Coal Creeper", 70);

EntityRegistry.addSpawn(EntityCoalCreeper.class, 12, 5, 5, EnumCreatureType.monster, BiomeGenBase.beach, BiomeGenBase.desert, BiomeGenBase.desertHills, BiomeGenBase.extremeHillsEdge,

BiomeGenBase.plains, BiomeGenBase.extremeHills, BiomeGenBase.forest, BiomeGenBase.forestHills, BiomeGenBase.frozenOcean, BiomeGenBase.frozenRiver, BiomeGenBase.iceMountains, BiomeGenBase.icePlains,

BiomeGenBase.jungle, BiomeGenBase.jungleHills, BiomeGenBase.swampland, BiomeGenBase.taiga, BiomeGenBase.taigaHills);

EntityRegistry.findGlobalUniqueEntityId();

registerSpawnEgg(EntityCoalCreeper.class, 0x000000, 0xFFFFCC);

 

 

 

 

Thanks in advance.

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.