• 0

    posted a message on Copious Dogs Mod

    Thanks. : )

    Posted in: WIP Mods
  • 0

    posted a message on Copious Dogs Mod

    When will this be updated to 1.10?

    Posted in: WIP Mods
  • 0

    posted a message on How do I dye a wolf collar rainbow?

    Seri Pixel Biologist Has one of her dogs in zoo crafting (it's name is Iris) with a rainbow colored collar.


    Posted in: Discussion
  • 0

    posted a message on How do I dye a wolf collar rainbow?

    Just What the title says... I googled it and searched the forums everywhere but I can't find anything on dying a collar rainbow.

    Posted in: Discussion
  • 0

    posted a message on Why is the mob invisible?

    Please!!!!! I need help!

    Posted in: Modification Development
  • 0

    posted a message on Why is the mob invisible?

    Anyone else? I really need help.

    Posted in: Modification Development
  • 0

    posted a message on Why is the mob invisible?

    Okay...I did entity instead of null, and I deleted setRenderPassModel, but it's still invisible with no shadow (if I hit it meat drops, so I know that it's there).

    Posted in: Modification Development
  • 0

    posted a message on Why is the mob invisible?

    Hi! The last forum post I said that the game was crashing...well, I fixed that. The problem is, when I spawn the mob, it's invisible.


    Here's the code:


    Client and Common proxies:


    package com.hatchnegg.mymod.proxies;

    import com.hatchnegg.mymod.entities.test.EntityTest;
    import com.hatchnegg.mymod.entities.test.ModelTest;
    import com.hatchnegg.mymod.entities.test.RenderTest;

    import cpw.mods.fml.client.registry.RenderingRegistry;

    public class ClientProxy extends CommonProxy {

    @Override
    public void registerRenderThings(){

    RenderingRegistry.registerEntityRenderingHandler(EntityTest.class, new RenderTest());

    }

    }



    package com.hatchnegg.mymod.proxies;

    public class CommonProxy {


    public void registerRenderThings() {

    }
    }



    Main class:


    package com.hatchnegg.mymod;

    import java.util.Random;

    import com.hatchnegg.mymod.entities.ModMonsterPlacer;
    import com.hatchnegg.mymod.entities.test.EntityTest;
    import com.hatchnegg.mymod.proxies.CommonProxy;
    import cpw.mods.fml.common.Mod;
    import cpw.mods.fml.common.Mod.EventHandler;
    import cpw.mods.fml.common.Mod.Instance;
    import cpw.mods.fml.common.SidedProxy;
    import cpw.mods.fml.common.event.FMLInitializationEvent;
    import cpw.mods.fml.common.event.FMLPostInitializationEvent;
    import cpw.mods.fml.common.event.FMLPreInitializationEvent;
    import cpw.mods.fml.common.registry.EntityRegistry;
    import cpw.mods.fml.common.registry.GameRegistry;
    import net.minecraft.entity.EntityList;
    import net.minecraft.item.Item;

    @Mod(modid = Main.MODID, name = Main.MODNAME, version = Main.VERSION)
    public class Main {

    public static final String MODID = "mymod";
    public static final String MODNAME = "Mo Creatures TWO";
    public static final String VERSION = "2.0.0";

    @Instance
    public static Main instance = new Main();

    @SidedProxy(clientSide = "com.hatchnegg.mymod.proxies.ClientProxy", serverSide = "com.hatchnegg.mymod.proxies.CommonProxy" )
    public static CommonProxy proxy;

    /* ************ Declaration section ************************* */






    /* End of this section */

    @EventHandler
    public void preInit(FMLPreInitializationEvent e) {
    /* ************* Load section ******************************* */

    //Entities

    //Only do int id 1 time for all mobs
    int modEntityID = 0;

    //Register the test creature, render, and make the spawn egg
    EntityRegistry.registerModEntity(EntityTest.class, "Test Creature", ++modEntityID, instance, 80, 3, false);

    Item itemSpawnEgg = new ModMonsterPlacer("Test Creature", 0x000000, 0xFFFFFF)
    .setUnlocalizedName ("spawn_egg_")
    .setTextureName("spawn_egg");
    GameRegistry.registerItem(itemSpawnEgg, "spawnEgg");

    proxy.registerRenderThings();


    /* End of this section */
    }

    @EventHandler
    public void init(FMLInitializationEvent e) {
    /* ************ Recipes and extras section *********************/






    /* End of this section */
    }

    @EventHandler
    public void postInit(FMLPostInitializationEvent e) {

    }
    }


    EntityTest, RenderTest, and ModelTest:


    package com.hatchnegg.mymod.entities.test;

    import net.minecraft.block.Block;
    import net.minecraft.entity.EntityAgeable;
    import net.minecraft.entity.SharedMonsterAttributes;
    import net.minecraft.entity.ai.EntityAIFollowParent;
    import net.minecraft.entity.ai.EntityAILookIdle;
    import net.minecraft.entity.ai.EntityAIMate;
    import net.minecraft.entity.ai.EntityAIPanic;
    import net.minecraft.entity.ai.EntityAISwimming;
    import net.minecraft.entity.ai.EntityAITempt;
    import net.minecraft.entity.ai.EntityAIWander;
    import net.minecraft.entity.ai.EntityAIWatchClosest;
    import net.minecraft.entity.passive.EntityAnimal;
    import net.minecraft.entity.player.EntityPlayer;
    import net.minecraft.init.Items;
    import net.minecraft.item.Item;
    import net.minecraft.item.ItemStack;
    import net.minecraft.world.World;

    public class EntityTest extends EntityAnimal
    {
    private static final String __OBFID = "CL_00001640";

    public EntityTest(World p_i1683_1_)
    {
    super(p_i1683_1_);
    this.setSize(0.9F, 1.3F);
    this.getNavigator().setAvoidsWater(true);
    this.tasks.addTask(0, new EntityAISwimming(this));
    this.tasks.addTask(1, new EntityAIPanic(this, 2.0D));
    this.tasks.addTask(2, new EntityAIMate(this, 1.0D));
    this.tasks.addTask(3, new EntityAITempt(this, 1.25D, Items.wheat, false));
    this.tasks.addTask(4, new EntityAIFollowParent(this, 1.25D));
    this.tasks.addTask(5, new EntityAIWander(this, 1.0D));
    this.tasks.addTask(6, new EntityAIWatchClosest(this, EntityPlayer.class, 6.0F));
    this.tasks.addTask(7, new EntityAILookIdle(this));
    }

    /**
    * Returns true if the newer Entity AI code should be run
    */
    public boolean isAIEnabled()
    {
    return true;
    }

    protected void applyEntityAttributes()
    {
    super.applyEntityAttributes();
    this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(10.0D);
    this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.20000000298023224D);
    }

    /**
    * Returns the sound this mob makes while it's alive.
    */
    protected String getLivingSound()
    {
    return "mob.cow.say";
    }

    /**
    * Returns the sound this mob makes when it is hurt.
    */
    protected String getHurtSound()
    {
    return "mob.cow.hurt";
    }

    /**
    * Returns the sound this mob makes on death.
    */
    protected String getDeathSound()
    {
    return "mob.cow.hurt";
    }

    protected void func_145780_a(int p_145780_1_, int p_145780_2_, int p_145780_3_, Block p_145780_4_)
    {
    this.playSound("mob.cow.step", 0.15F, 1.0F);
    }

    /**
    * Returns the volume for the sounds this mob makes.
    */
    protected float getSoundVolume()
    {
    return 0.4F;
    }

    protected Item getDropItem()
    {
    return Items.leather;
    }

    /**
    * Drop 0-2 items of this living's type. @param par1 - Whether this entity has recently been hit by a player. @param
    * par2 - Level of Looting used to kill this mob.
    */
    protected void dropFewItems(boolean p_70628_1_, int p_70628_2_)
    {
    int j = this.rand.nextInt(3) + this.rand.nextInt(1 + p_70628_2_);
    int k;

    for (k = 0; k < j; ++k)
    {
    this.dropItem(Items.leather, 1);
    }

    j = this.rand.nextInt(3) + 1 + this.rand.nextInt(1 + p_70628_2_);

    for (k = 0; k < j; ++k)
    {
    if (this.isBurning())
    {
    this.dropItem(Items.cooked_beef, 1);
    }
    else
    {
    this.dropItem(Items.beef, 1);
    }
    }
    }

    /**
    * Called when a player interacts with a mob. e.g. gets milk from a cow, gets into the saddle on a pig.
    */
    public boolean interact(EntityPlayer p_70085_1_)
    {
    ItemStack itemstack = p_70085_1_.inventory.getCurrentItem();

    if (itemstack != null && itemstack.getItem() == Items.wheat && !p_70085_1_.capabilities.isCreativeMode)
    {
    if (itemstack.stackSize-- == 1)
    {
    p_70085_1_.inventory.setInventorySlotContents(p_70085_1_.inventory.currentItem, new ItemStack(Items.bread));
    }
    else if (!p_70085_1_.inventory.addItemStackToInventory(new ItemStack(Items.bread)))
    {
    p_70085_1_.dropPlayerItemWithRandomChoice(new ItemStack(Items.bread, 1, 0), false);
    }

    return true;
    }
    else
    {
    return super.interact(p_70085_1_);
    }
    }

    public EntityTest createChild(EntityAgeable p_90011_1_)
    {
    return new EntityTest(this.worldObj);
    }
    }



    package com.hatchnegg.mymod.entities.test;

    import com.hatchnegg.mymod.Main;

    import net.minecraft.client.renderer.entity.RenderBiped;
    import net.minecraft.client.renderer.entity.RenderLiving;
    import net.minecraft.entity.Entity;
    import net.minecraft.util.ResourceLocation;

    public class RenderTest extends RenderLiving{

    public RenderTest(){
    super(new ModelTest(), 0.5F);
    setRenderPassModel(mainModel);
    }

    @Override
    protected ResourceLocation getEntityTexture(Entity entity)
    {
    return new ResourceLocation(Main.MODID + ":textures/entities/entitytest.png");
    }
    }



    package com.hatchnegg.mymod.entities.test;

    import net.minecraft.client.model.ModelBase;
    import net.minecraft.client.model.ModelRenderer;
    import net.minecraft.entity.Entity;
    import net.minecraft.entity.EntityLivingBase;
    import net.minecraft.entity.passive.EntityWolf;
    import net.minecraft.util.MathHelper;

    public class ModelTest extends ModelBase {
    //fields
    ModelRenderer WolfHead;
    ModelRenderer Body;
    ModelRenderer Mane;
    ModelRenderer Leg1;
    ModelRenderer Leg2;
    ModelRenderer Leg3;
    ModelRenderer Leg4;
    ModelRenderer Tail;
    ModelRenderer Ear1;
    ModelRenderer Ear2;
    ModelRenderer Nose;

    public ModelTest()
    {
    textureWidth = 64;
    textureHeight = 32;

    WolfHead = new ModelRenderer(this, 0, 0);
    WolfHead.addBox(-3F, -3F, -2F, 6, 6, 4);
    WolfHead.setRotationPoint(-1F, 13.5F, -7F);
    WolfHead.setTextureSize(64, 32);
    WolfHead.mirror = true;
    setRotation(WolfHead, 0F, 0F, 0F);
    Body = new ModelRenderer(this, 18, 14);
    Body.addBox(-4F, -2F, -3F, 6, 9, 6);
    Body.setRotationPoint(0F, 14F, 2F);
    Body.setTextureSize(64, 32);
    Body.mirror = true;
    setRotation(Body, 1.570796F, 0F, 0F);
    Mane = new ModelRenderer(this, 21, 0);
    Mane.addBox(-4F, -3F, -3F, 8, 6, 7);
    Mane.setRotationPoint(-1F, 14F, -3F);
    Mane.setTextureSize(64, 32);
    Mane.mirror = true;
    setRotation(Mane, 1.570796F, 0F, 0F);
    Leg1 = new ModelRenderer(this, 0, 18);
    Leg1.addBox(-1F, 0F, -1F, 2, 8, 2);
    Leg1.setRotationPoint(-2.5F, 16F, 7F);
    Leg1.setTextureSize(64, 32);
    Leg1.mirror = true;
    setRotation(Leg1, 0F, 0F, 0F);
    Leg2 = new ModelRenderer(this, 0, 18);
    Leg2.addBox(-1F, 0F, -1F, 2, 8, 2);
    Leg2.setRotationPoint(0.5F, 16F, 7F);
    Leg2.setTextureSize(64, 32);
    Leg2.mirror = true;
    setRotation(Leg2, 0F, 0F, 0F);
    Leg3 = new ModelRenderer(this, 0, 18);
    Leg3.addBox(-1F, 0F, -1F, 2, 8, 2);
    Leg3.setRotationPoint(-2.5F, 16F, -4F);
    Leg3.setTextureSize(64, 32);
    Leg3.mirror = true;
    setRotation(Leg3, 0F, 0F, 0F);
    Leg4 = new ModelRenderer(this, 0, 18);
    Leg4.addBox(-1F, 0F, -1F, 2, 8, 2);
    Leg4.setRotationPoint(0.5F, 16F, -4F);
    Leg4.setTextureSize(64, 32);
    Leg4.mirror = true;
    setRotation(Leg4, 0F, 0F, 0F);
    Tail = new ModelRenderer(this, 9, 18);
    Tail.addBox(-1F, 0F, -1F, 2, 8, 2);
    Tail.setRotationPoint(-1F, 12F, 8F);
    Tail.setTextureSize(64, 32);
    Tail.mirror = true;
    setRotation(Tail, 1.130069F, 0F, 0F);
    Ear1 = new ModelRenderer(this, 16, 14);
    Ear1.addBox(-3F, -5F, 0F, 2, 2, 1);
    Ear1.setRotationPoint(-1F, 13.5F, -7F);
    Ear1.setTextureSize(64, 32);
    Ear1.mirror = true;
    setRotation(Ear1, 0F, 0F, 0F);
    Ear2 = new ModelRenderer(this, 16, 14);
    Ear2.addBox(1F, -5F, 0F, 2, 2, 1);
    Ear2.setRotationPoint(-1F, 13.5F, -7F);
    Ear2.setTextureSize(64, 32);
    Ear2.mirror = true;
    setRotation(Ear2, 0F, 0F, 0F);
    Nose = new ModelRenderer(this, 0, 10);
    Nose.addBox(-2F, 0F, -5F, 3, 3, 4);
    Nose.setRotationPoint(-0.5F, 13.5F, -7F);
    Nose.setTextureSize(64, 32);
    Nose.mirror = true;
    setRotation(Nose, 0F, 0F, 0F);
    }

    public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5)
    {
    super.render(entity, f, f1, f2, f3, f4, f5);
    setRotationAngles(f, f1, f2, f3, f4, f5);
    WolfHead.render(f5);
    Body.render(f5);
    Mane.render(f5);
    Leg1.render(f5);
    Leg2.render(f5);
    Leg3.render(f5);
    Leg4.render(f5);
    Tail.render(f5);
    Ear1.render(f5);
    Ear2.render(f5);
    Nose.render(f5);
    }

    /**
    * 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 p_78086_1_, float p_78086_2_, float p_78086_3_, float p_78086_4_)
    {
    EntityWolf entitywolf = (EntityWolf)p_78086_1_;

    this.Body.setRotationPoint(0.0F, 14.0F, 2.0F);
    this.Body.rotateAngleX = ((float)Math.PI / 2F);
    this.Mane.setRotationPoint(-1.0F, 14.0F, -3.0F);
    this.Mane.rotateAngleX = this.Body.rotateAngleX;
    this.Tail.setRotationPoint(-1.0F, 12.0F, 8.0F);
    this.Leg1.setRotationPoint(-2.5F, 16.0F, 7.0F);
    this.Leg2.setRotationPoint(0.5F, 16.0F, 7.0F);
    this.Leg3.setRotationPoint(-2.5F, 16.0F, -4.0F);
    this.Leg4.setRotationPoint(0.5F, 16.0F, -4.0F);
    this.Leg1.rotateAngleX = MathHelper.cos(p_78086_2_ * 0.6662F) * 1.4F * p_78086_3_;
    this.Leg2.rotateAngleX = MathHelper.cos(p_78086_2_ * 0.6662F + (float)Math.PI) * 1.4F * p_78086_3_;
    this.Leg3.rotateAngleX = MathHelper.cos(p_78086_2_ * 0.6662F + (float)Math.PI) * 1.4F * p_78086_3_;
    this.Leg4.rotateAngleX = MathHelper.cos(p_78086_2_ * 0.6662F) * 1.4F * p_78086_3_;

    }

    private void setRotation(ModelRenderer model, float x, float y, float z)
    {
    model.rotateAngleX = x;
    model.rotateAngleY = y;
    model.rotateAngleZ = z;
    }

    public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5)
    {
    super.setRotationAngles(f, f1, f2, f3, f4, f5, null);
    this.WolfHead.rotateAngleX = f4 / (180F / (float)Math.PI);
    this.WolfHead.rotateAngleY = f3 / (180F / (float)Math.PI);
    this.Tail.rotateAngleX = f2;
    }

    }


    ModMonsterPlacer (the spawn egg class):



    package com.hatchnegg.mymod.entities;

    import java.util.List;
    import com.hatchnegg.mymod.Main;
    import cpw.mods.fml.relauncher.Side;
    import cpw.mods.fml.relauncher.SideOnly;
    import net.minecraft.block.BlockLiquid;
    import net.minecraft.client.renderer.texture.IIconRegister;
    import net.minecraft.creativetab.CreativeTabs;
    import net.minecraft.entity.Entity;
    import net.minecraft.entity.EntityList;
    import net.minecraft.entity.EntityLiving;
    import net.minecraft.entity.EntityLivingBase;
    import net.minecraft.entity.IEntityLivingData;
    import net.minecraft.entity.player.EntityPlayer;
    import net.minecraft.item.Item;
    import net.minecraft.item.ItemMonsterPlacer;
    import net.minecraft.item.ItemStack;
    import net.minecraft.util.Facing;
    import net.minecraft.util.IIcon;
    import net.minecraft.util.MathHelper;
    import net.minecraft.util.MovingObjectPosition;
    import net.minecraft.world.World;
    import net.minecraft.world.biome.BiomeCache.Block;

    public class ModMonsterPlacer extends ItemMonsterPlacer
    {
    @SideOnly(Side.CLIENT)
    private IIcon theIcon;
    protected int colorBase = 0x000000;
    protected int colorSpots = 0xFFFFFF;
    protected String entityToSpawnName = "";
    protected String entityToSpawnNameFull = "";
    protected EntityLiving entityToSpawn = null;

    public ModMonsterPlacer()
    {
    super();
    }

    public ModMonsterPlacer(String parEntityToSpawnName, int parPrimaryColor,
    int parSecondaryColor)
    {
    setHasSubtypes(false);
    maxStackSize = 64;
    setCreativeTab(CreativeTabs.tabMisc);
    setEntityToSpawnName(parEntityToSpawnName);
    colorBase = parPrimaryColor;
    colorSpots = parSecondaryColor;
    // DEBUG
    // System.out.println("Spawn egg constructor for "+entityToSpawnName);
    }

    /**
    * Callback for item usage. If the item does something special on right clicking,
    * he will have one of those. Return
    * True if something happen and false if it don't. This is for ITEMS, not BLOCKS
    */
    @Override
    public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer,
    World par3World, int par4, int par5, int par6, int par7, float par8,
    float par9, float par10)
    {
    if (par3World.isRemote)
    {
    return true;
    }
    else
    {
    net.minecraft.block.Block block = par3World.getBlock(par4, par5, par6);
    par4 += Facing.offsetsXForSide[par7];
    par5 += Facing.offsetsYForSide[par7];
    par6 += Facing.offsetsZForSide[par7];
    double d0 = 0.0D;

    if (par7 == 1 && block.getRenderType() == 11)
    {
    d0 = 0.5D;
    }

    Entity entity = spawnEntity(par3World, par4 + 0.5D, par5 + d0, par6 + 0.5D);

    if (entity != null)
    {
    if (entity instanceof EntityLivingBase && par1ItemStack.hasDisplayName())
    {
    ((EntityLiving)entity).setCustomNameTag(par1ItemStack.getDisplayName());
    }

    if (!par2EntityPlayer.capabilities.isCreativeMode)
    {
    --par1ItemStack.stackSize;
    }
    }

    return true;
    }
    }

    /**
    * Called whenever this item is equipped and the right mouse button is pressed.
    *Args: itemStack, world, entityPlayer
    */
    @Override
    public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World,
    EntityPlayer par3EntityPlayer)
    {
    if (par2World.isRemote)
    {
    return par1ItemStack;
    }
    else
    {
    MovingObjectPosition movingobjectposition =
    getMovingObjectPositionFromPlayer(par2World, par3EntityPlayer, true);

    if (movingobjectposition == null)
    {
    return par1ItemStack;
    }
    else
    {
    if (movingobjectposition.typeOfHit == MovingObjectPosition
    .MovingObjectType.BLOCK)
    {
    int i = movingobjectposition.blockX;
    int j = movingobjectposition.blockY;
    int k = movingobjectposition.blockZ;

    if (!par2World.canMineBlock(par3EntityPlayer, i, j, k))
    {
    return par1ItemStack;
    }

    if (!par3EntityPlayer.canPlayerEdit(i, j, k, movingobjectposition
    .sideHit, par1ItemStack))
    {
    return par1ItemStack;
    }

    if (par2World.getBlock(i, j, k) instanceof BlockLiquid)
    {
    Entity entity = spawnEntity(par2World, i, j, k);

    if (entity != null)
    {
    if (entity instanceof EntityLivingBase && par1ItemStack
    .hasDisplayName())
    {
    ((EntityLiving)entity).setCustomNameTag(par1ItemStack
    .getDisplayName());
    }

    if (!par3EntityPlayer.capabilities.isCreativeMode)
    {
    --par1ItemStack.stackSize;
    }
    }
    }
    }

    return par1ItemStack;
    }
    }
    }

    /**
    * Spawns the creature specified by the egg's type in the location specified by
    * the last three parameters.
    * Parameters: world, entityID, x, y, z.
    */
    public Entity spawnEntity(World parWorld, double parX, double parY, double parZ)
    {

    if (!parWorld.isRemote) // never spawn entity on client side
    {
    entityToSpawnNameFull = Main.MODID+"."+entityToSpawnName;
    if (EntityList.stringToClassMapping.containsKey(entityToSpawnNameFull))
    {
    entityToSpawn = (EntityLiving) EntityList
    .createEntityByName(entityToSpawnNameFull, parWorld);
    entityToSpawn.setLocationAndAngles(parX, parY, parZ,
    MathHelper.wrapAngleTo180_float(parWorld.rand.nextFloat()
    * 360.0F), 0.0F);
    parWorld.spawnEntityInWorld(entityToSpawn);
    entityToSpawn.onSpawnWithEgg((IEntityLivingData)null);
    entityToSpawn.playLivingSound();
    }
    else
    {
    //DEBUG
    System.out.println("Entity not found "+entityToSpawnName);
    }
    }

    return entityToSpawn;
    }

    /**
    * returns a list of items with the same ID, but different meta (eg: dye returns 16 items)
    */
    @Override
    @SideOnly(Side.CLIENT)
    public void getSubItems(Item parItem, CreativeTabs parTab, List parList)
    {
    parList.add(new ItemStack(parItem, 1, 0));
    }

    @Override
    @SideOnly(Side.CLIENT)
    public int getColorFromItemStack(ItemStack par1ItemStack, int parColorType)
    {
    return (parColorType == 0) ? colorBase : colorSpots;
    }

    @Override
    @SideOnly(Side.CLIENT)
    public boolean requiresMultipleRenderPasses()
    {
    return true;
    }

    @Override
    // Doing this override means that there is no localization for language
    // unless you specifically check for localization here and convert
    public String getItemStackDisplayName(ItemStack par1ItemStack)
    {
    return "Spawn "+entityToSpawnName;
    }

    @Override
    @SideOnly(Side.CLIENT)
    public void registerIcons(IIconRegister par1IconRegister)
    {
    super.registerIcons(par1IconRegister);
    theIcon = par1IconRegister.registerIcon(getIconString() + "");
    }

    /**
    * Gets an icon index based on an item's damage value and the given render pass
    */
    @Override
    @SideOnly(Side.CLIENT)
    public IIcon getIconFromDamageForRenderPass(int parDamageVal, int parRenderPass)
    {
    return parRenderPass > 0 ? theIcon : super.getIconFromDamageForRenderPass(parDamageVal,
    parRenderPass);
    }

    public void setColors(int parColorBase, int parColorSpots)
    {
    colorBase = parColorBase;
    colorSpots = parColorSpots;
    }

    public int getColorBase()
    {
    return colorBase;
    }

    public int getColorSpots()
    {
    return colorSpots;
    }

    public void setEntityToSpawnName(String parEntityToSpawnName)
    {
    entityToSpawnName = parEntityToSpawnName;
    entityToSpawnNameFull = Main.MODID+"."+entityToSpawnName;
    }

    }


    The resource location:




    Help would be really appreciated.

    Posted in: Modification Development
  • 0

    posted a message on ive been having this problem for a long time and its starting to get annoying

    Try an older version of java...if you are using java 8, the newest version of 8, you might want to downgrade to a different version of java 8. I was crashing too and I installed a different version (still 8, but a different release) and it worked. I'll edit this post once I find the exact version that I am using.

    Posted in: Java Edition Support
  • 0

    posted a message on Help with Mob registration! Game Crash!

    That didn't work.

    Posted in: Modification Development
  • 0

    posted a message on Help with Mob registration! Game Crash!

    Ugh...K. Here's the crash report.



    ---- Minecraft Crash Report ----
    // Why did you do that?

    Time: 7/13/16 6:17 PM
    Description: Initializing game

    java.lang.NullPointerException: Initializing game
    at com.hatchnegg.mymod.entities.giraffe.ModelGiraffe.<init>(ModelGiraffe.java:202)
    at com.hatchnegg.mymod.proxies.ClientProxy.preInit(ClientProxy.java:21)
    at com.hatchnegg.mymod.Main.preInit(Main.java:98)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at cpw.mods.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:532)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74)
    at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47)
    at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322)
    at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304)
    at com.google.common.eventbus.EventBus.post(EventBus.java:275)
    at cpw.mods.fml.common.LoadController.sendEventToModContainer(LoadController.java:212)
    at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:190)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74)
    at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47)
    at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322)
    at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304)
    at com.google.common.eventbus.EventBus.post(EventBus.java:275)
    at cpw.mods.fml.common.LoadController.distributeStateMessage(LoadController.java:119)
    at cpw.mods.fml.common.Loader.preinitializeMods(Loader.java:556)
    at cpw.mods.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:243)
    at net.minecraft.client.Minecraft.startGame(Minecraft.java:522)
    at net.minecraft.client.Minecraft.run(Minecraft.java:942)
    at net.minecraft.client.main.Main.main(Main.java:164)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)
    at net.minecraft.launchwrapper.Launch.main(Launch.java:28)
    at net.minecraftforge.gradle.GradleStartCommon.launch(Unknown Source)
    at GradleStart.main(Unknown Source)

    A detailed walkthrough of the error, its code path and all known details is as follows:
    ---------------------------------------------------------------------------------------

    -- Head --
    Stacktrace:
    at com.hatchnegg.mymod.entities.giraffe.ModelGiraffe.<init>(ModelGiraffe.java:202)
    at com.hatchnegg.mymod.proxies.ClientProxy.preInit(ClientProxy.java:21)
    at com.hatchnegg.mymod.Main.preInit(Main.java:98)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at cpw.mods.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:532)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74)
    at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47)
    at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322)
    at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304)
    at com.google.common.eventbus.EventBus.post(EventBus.java:275)
    at cpw.mods.fml.common.LoadController.sendEventToModContainer(LoadController.java:212)
    at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:190)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74)
    at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47)
    at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322)
    at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304)
    at com.google.common.eventbus.EventBus.post(EventBus.java:275)
    at cpw.mods.fml.common.LoadController.distributeStateMessage(LoadController.java:119)
    at cpw.mods.fml.common.Loader.preinitializeMods(Loader.java:556)
    at cpw.mods.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:243)
    at net.minecraft.client.Minecraft.startGame(Minecraft.java:522)

    -- Initialization --
    Details:
    Stacktrace:
    at net.minecraft.client.Minecraft.run(Minecraft.java:942)
    at net.minecraft.client.main.Main.main(Main.java:164)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)
    at net.minecraft.launchwrapper.Launch.main(Launch.java:28)
    at net.minecraftforge.gradle.GradleStartCommon.launch(Unknown Source)
    at GradleStart.main(Unknown Source)

    -- System Details --
    Details:
    Minecraft Version: 1.7.10
    Operating System: Windows 7 (amd64) version 6.1
    Java Version: 1.7.0_79, Oracle Corporation
    Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
    Memory: 772626312 bytes (736 MB) / 1038876672 bytes (990 MB) up to 1038876672 bytes (990 MB)
    JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M
    AABB Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used
    IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0
    FML: MCP v9.05 FML v7.10.99.99 Minecraft Forge 10.13.4.1558 6 mods loaded, 6 mods active
    States: 'U' = Unloaded 'L' = Loaded 'C' = Constructed 'H' = Pre-initialized 'I' = Initialized 'J' = Post-initialized 'A' = Available 'D' = Disabled 'E' = Errored
    UCH mcp{9.05} [Minecraft Coder Pack] (minecraft.jar)
    UCH FML{7.10.99.99} [Forge Mod Loader] (forgeSrc-1.7.10-10.13.4.1558-1.7.10.jar)
    UCH Forge{10.13.4.1558} [Minecraft Forge] (forgeSrc-1.7.10-10.13.4.1558-1.7.10.jar)
    UCE mymod{1.0.0} [Mo Creatures 2] (bin)
    UCH AnimationAPI{1.2.3} [AnimationAPI] (bin)
    UCH AnimationExample{1.0.0} [Animation Example] (bin)
    GL info: ' Vendor: 'Intel' Version: '3.1.0 - Build 9.17.10.3347' Renderer: 'Intel(R) HD Graphics 3000'
    Launched Version: 1.7.10
    LWJGL: 2.9.1
    OpenGL: Intel(R) HD Graphics 3000 GL version 3.1.0 - Build 9.17.10.3347, Intel
    GL Caps: Using GL 1.3 multitexturing.
    Using framebuffer objects because OpenGL 3.0 is supported and separate blending is supported.
    Anisotropic filtering is supported and maximum anisotropy is 16.
    Shaders are available because OpenGL 2.1 is supported.

    Is Modded: Definitely; Client brand changed to 'fml,forge'
    Type: Client (map_client.txt)
    Resource Packs: []
    Current Language: English (US)
    Profiler Position: N/A (disabled)
    Vec3 Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used
    Anisotropic Filtering: Off (1)

    Posted in: Modification Development
  • 0

    posted a message on Help with Mob registration! Game Crash!

    Hi! I am trying to figure out mob registration for 1.7... with my code, the game crashes. I'll post it here:


    What code I did in the main class:


    @EventHandler
    public void preInit(FMLPreInitializationEvent e) {

    proxy.preInit(e);


    /Entities

    //Register the entities and their spawn eggs
    EntityRegistry.registerModEntity(EntityGiraffe.class, "Giraffe", 159, instance, 64, 1, true);

    //Spawn areas of the entities
    EntityRegistry.addSpawn(EntityGiraffe.class, 20, 1, 5, EnumCreatureType.creature,
    BiomeGenBase.savanna); //change the values to vary the spawn rarity, biome, etc.




    }



    What code I did in Client Proxy:


    @Override
    public void preInit(FMLPreInitializationEvent e) {

    super.preInit(e);

    //Entities
    //TEMPLATE: RenderingRegistry.registerEntityRenderingHandler(Entityblank.class, new Renderblank(new Modelblank(), 0.5F));
    RenderingRegistry.registerEntityRenderingHandler(EntityGiraffe.class, new RenderGiraffe(new ModelGiraffe(), 0.5F));
    }


    Entity, Model, and Render Classes:


    package com.hatchnegg.mymod.entities.giraffe;

    import net.minecraft.entity.EntityAgeable;
    import net.minecraft.entity.EntityCreature;
    import net.minecraft.entity.SharedMonsterAttributes;
    import net.minecraft.entity.ai.EntityAIAttackOnCollide;
    import net.minecraft.entity.ai.EntityAIBeg;
    import net.minecraft.entity.ai.EntityAILeapAtTarget;
    import net.minecraft.entity.ai.EntityAILookIdle;
    import net.minecraft.entity.ai.EntityAIMate;
    import net.minecraft.entity.ai.EntityAISwimming;
    import net.minecraft.entity.ai.EntityAITempt;
    import net.minecraft.entity.ai.EntityAIWander;
    import net.minecraft.entity.ai.EntityAIWatchClosest;
    import net.minecraft.entity.passive.EntityPig;
    import net.minecraft.entity.passive.IAnimals;
    import net.minecraft.entity.player.EntityPlayer;
    import net.minecraft.init.Blocks;
    import net.minecraft.init.Items;
    import net.minecraft.item.Item;
    import net.minecraft.item.ItemStack;
    import net.minecraft.util.DamageSource;
    import net.minecraft.world.World;

    public class EntityGiraffe extends EntityCreature {

    @Override
    protected boolean isAIEnabled() {
    return true;
    }

    public EntityGiraffe(World par1World)
    {
    super(par1World);
    this.setSize(0.9F, 1.3F);
    this.getNavigator().setAvoidsWater(true);
    this.tasks.addTask(1, new EntityAISwimming(this));
    this.tasks.addTask(2, new EntityAILeapAtTarget(this, 0.4F));
    this.tasks.addTask(3, new EntityAITempt(this, 1.0F, Items.wheat, false));
    this.tasks.addTask(4, new EntityAIAttackOnCollide(this, 1.0D, true));
    this.tasks.addTask(5, new EntityAIWander(this, 1.0D));
    this.tasks.addTask(6, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F));
    this.tasks.addTask(7, new EntityAILookIdle(this));

    }

    protected void applyEntityAttributes()
    {
    super.applyEntityAttributes();
    this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(40.0D);
    this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.25D);
    }

    //Returns breeding item.
    public boolean isBreedingItem(ItemStack p_70877_1_)
    {
    return p_70877_1_ != null && p_70877_1_.getItem() == Items.apple;
    }


    //Drop items if is or is not burning
    protected Item getDropItem()
    {
    return this.isBurning() ? Items.cooked_porkchop : Items.porkchop;
    }

    /**
    * Drop 0-2 items of this living's type. @param par1 - Whether this entity has recently been hit by a player. @param
    * par2 - Level of Looting used to kill this mob.
    */
    protected void dropFewItems(boolean p_70628_1_, int p_70628_2_)
    {
    int j = this.rand.nextInt(3) + 1 + this.rand.nextInt(1 + p_70628_2_);

    for (int k = 0; k < j; ++k)
    {
    if (this.isBurning())
    {
    this.dropItem(Items.cooked_porkchop, 1);
    }
    else
    {
    this.dropItem(Items.porkchop, 1);
    }
    }
    }

    public EntityPig createChild(EntityAgeable p_90011_1_)
    {
    return new EntityPig(this.worldObj);
    }



    }



    package com.hatchnegg.mymod.entities.giraffe;

    import org.lwjgl.opengl.GL11;

    import net.minecraft.client.model.ModelBase;
    import net.minecraft.client.model.ModelRenderer;
    import net.minecraft.entity.Entity;
    import net.minecraft.util.MathHelper;

    public class ModelGiraffe extends ModelBase
    {

    //Declaring the Boxes/Parts
    ModelRenderer Shoulder;
    ModelRenderer ManeShoulder;
    ModelRenderer Neck1;
    ModelRenderer ManeNeck1;
    ModelRenderer Neck2;
    ModelRenderer ManeNeck2;
    ModelRenderer Neck3;
    ModelRenderer ManeNeck3;
    ModelRenderer Head;
    ModelRenderer ManeHead;
    ModelRenderer MuzzleTop;
    ModelRenderer MuzzleMiddle;
    ModelRenderer MuzzleMouth;
    ModelRenderer HeadTop;
    ModelRenderer StumpR;
    ModelRenderer StumpL;
    ModelRenderer EarR;
    ModelRenderer EarL;
    ModelRenderer Back;
    ModelRenderer Belly;
    ModelRenderer FRLegTop;
    ModelRenderer FRLegMiddle;
    ModelRenderer FRLegBottom;
    ModelRenderer FRHoof;
    ModelRenderer FLLegTop;
    ModelRenderer FLLegMiddle;
    ModelRenderer FLLegBottom;
    ModelRenderer FLHoof;
    ModelRenderer BRLegTop;
    ModelRenderer BRLegMiddle;
    ModelRenderer BRLegBottom;
    ModelRenderer BRHoof;
    ModelRenderer BLLegTop;
    ModelRenderer BLLegMiddle;
    ModelRenderer BLLegBottom;
    ModelRenderer BLHoof;
    ModelRenderer TailTop;
    ModelRenderer TailBottom;

    public ModelGiraffe()
    {
    textureWidth = 256;
    textureHeight = 128;

    Shoulder = new ModelRenderer(this, 1, 0);
    Shoulder.addBox(-4.5F, -7F, -3.5F, 9, 7, 7);//First three in addBox are x,y,z locations and the next 3 are dimensions.
    Shoulder.setRotationPoint(0F, -10.2F, -4F);
    Shoulder.setTextureSize(256, 128);
    Shoulder.mirror = true;
    setRotation(Shoulder, 0.5576792F, 0F, 0F);
    ManeShoulder = new ModelRenderer(this, 34, 38);
    ManeShoulder.addBox(0F, 0F, 0F, 0, 8, 2);
    ManeShoulder.setRotationPoint(0F, -18F, -5F);
    ManeShoulder.setTextureSize(256, 128);
    ManeShoulder.mirror = true;
    setRotation(ManeShoulder, 0.4670839F, 0F, 0F);
    Neck1 = new ModelRenderer(this, 1, 17);
    Neck1.addBox(-3.5F, -9F, -3.5F, 7, 9, 7);
    Neck1.setRotationPoint(0F, -12.63333F, -6.5F);
    Neck1.setTextureSize(256, 128);
    Neck1.mirror = true;
    setRotation(Neck1, 0.3740581F, 0F, 0F);
    ManeNeck1 = new ModelRenderer(this, 34, 38);
    ManeNeck1.addBox(0F, 0F, 0F, 0, 5, 2);
    ManeNeck1.setRotationPoint(0F, -22F, -7F);
    ManeNeck1.setTextureSize(256, 128);
    ManeNeck1.mirror = true;
    setRotation(ManeNeck1, 0.4299053F, 0F, 0F);
    Neck2 = new ModelRenderer(this, 1, 34);
    Neck2.addBox(-3F, -9F, -3F, 6, 9, 6);
    Neck2.setRotationPoint(0F, -20.7F, -9.7F);
    Neck2.setTextureSize(256, 128);
    Neck2.mirror = true;
    setRotation(Neck2, 0.374059F, 0F, 0F);
    ManeNeck2 = new ModelRenderer(this, 34, 38);
    ManeNeck2.addBox(0F, 0F, 0F, 0, 9, 2);
    ManeNeck2.setRotationPoint(0F, -30F, -10.5F);
    ManeNeck2.setTextureSize(256, 128);
    ManeNeck2.mirror = true;
    setRotation(ManeNeck2, 0.3927267F, 0F, 0F);
    Neck3 = new ModelRenderer(this, 1, 50);
    Neck3.addBox(-2.5F, -9F, -2.5F, 5, 9, 5);
    Neck3.setRotationPoint(0F, -28.8F, -13F);
    Neck3.setTextureSize(256, 128);
    Neck3.mirror = true;
    setRotation(Neck3, 0.3368804F, 0F, 0F);
    ManeNeck3 = new ModelRenderer(this, 34, 38);
    ManeNeck3.addBox(0F, 0F, 0F, 0, 8, 2);
    ManeNeck3.setRotationPoint(0F, -37F, -13.5F);
    ManeNeck3.setTextureSize(256, 128);
    ManeNeck3.mirror = true;
    setRotation(ManeNeck3, 0.355548F, 0F, 0F);
    Head = new ModelRenderer(this, 1, 66);
    Head.addBox(-2.5F, -5F, -2.5F, 5, 5, 5);
    Head.setRotationPoint(0F, -37.3F, -15.9F);
    Head.setTextureSize(256, 128);
    Head.mirror = true;
    setRotation(Head, 0.3368835F, 0F, 0F);
    ManeHead = new ModelRenderer(this, 34, 38);
    ManeHead.addBox(0F, 0F, 0F, 0, 7, 2);
    ManeHead.setRotationPoint(0F, -43F, -16F);
    ManeHead.setTextureSize(256, 128);
    ManeHead.mirror = true;
    setRotation(ManeHead, 0.355548F, 0F, 0F);
    MuzzleTop = new ModelRenderer(this, 1, 105);
    MuzzleTop.addBox(-1F, -1F, -6F, 2, 2, 6);
    MuzzleTop.setRotationPoint(0F, -40.4F, -19F);
    MuzzleTop.setTextureSize(256, 128);
    MuzzleTop.mirror = true;
    setRotation(MuzzleTop, 0.5188895F, 0F, 0F);
    MuzzleMiddle = new ModelRenderer(this, 1, 95);
    MuzzleMiddle.addBox(-1.5F, 0F, -5F, 3, 2, 7);
    MuzzleMiddle.setRotationPoint(0F, -39F, -20.8F);
    MuzzleMiddle.setTextureSize(256, 128);
    MuzzleMiddle.mirror = true;
    setRotation(MuzzleMiddle, 0.1843479F, 0F, 0F);
    MuzzleMouth = new ModelRenderer(this, 1, 85);
    MuzzleMouth.addBox(-1F, 0F, -6F, 2, 1, 7);
    MuzzleMouth.setRotationPoint(0F, -37.5F, -19F);
    MuzzleMouth.setTextureSize(256, 128);
    MuzzleMouth.mirror = true;
    setRotation(MuzzleMouth, 0.1471693F, 0F, 0F);
    HeadTop = new ModelRenderer(this, 1, 77);
    HeadTop.addBox(-1F, -1F, 0F, 2, 2, 4);
    HeadTop.setRotationPoint(0F, -40.5F, -19F);
    HeadTop.setTextureSize(256, 128);
    HeadTop.mirror = true;
    setRotation(HeadTop, 0.5613041F, 0F, 0F);
    StumpR = new ModelRenderer(this, 15, 79);
    StumpR.addBox(-0.5F, -2F, -0.5F, 1, 2, 1);
    StumpR.setRotationPoint(-1.7F, -42F, -16.5F);
    StumpR.setTextureSize(256, 128);
    StumpR.mirror = true;
    setRotation(StumpR, 0F, 0F, 0F);
    StumpL = new ModelRenderer(this, 15, 79);
    StumpL.addBox(-0.5F, -2F, -0.5F, 1, 2, 1);
    StumpL.setRotationPoint(1.7F, -42F, -16.5F);
    StumpL.setTextureSize(256, 128);
    StumpL.mirror = true;
    setRotation(StumpL, 0F, 0F, 0F);
    EarR = new ModelRenderer(this, 25, 79);
    EarR.addBox(-2F, -3F, 0F, 2, 3, 0);
    EarR.setRotationPoint(-1F, -42.5F, -15.5F);
    EarR.setTextureSize(256, 128);
    EarR.mirror = true;
    setRotation(EarR, 0F, 0.0546327F, -0.4461433F);
    EarL = new ModelRenderer(this, 25, 79);
    EarL.addBox(0F, -3F, 0F, 2, 3, 0);
    EarL.setRotationPoint(1F, -42.5F, -15.5F);
    EarL.setTextureSize(256, 128);
    EarL.mirror = true;
    setRotation(EarL, 0F, 0.0546288F, 0.4461411F);
    Back = new ModelRenderer(this, 34, 0);
    Back.addBox(-5F, -3.5F, 0F, 10, 8, 23);
    Back.setRotationPoint(0F, -11F, -10F);
    Back.setTextureSize(256, 128);
    Back.mirror = true;
    setRotation(Back, -0.2796017F, 0F, 0F);
    Belly = new ModelRenderer(this, 101, 0);
    Belly.addBox(-4F, 0F, -8.2F, 8, 6, 23);
    Belly.setRotationPoint(0F, -6.3F, -2.5F);
    Belly.setTextureSize(256, 128);
    Belly.mirror = true;
    setRotation(Belly, -0.0171042F, 0F, 0F);
    FRLegTop = new ModelRenderer(this, 94, 34);
    FRLegTop.addBox(-2.5F, 0F, -5.3F, 5, 10, 6);
    FRLegTop.setRotationPoint(-3.2F, -8F, -5.5F);
    FRLegTop.setTextureSize(256, 128);
    FRLegTop.mirror = true;
    setRotation(FRLegTop, -0.0349066F, 0F, 0F);
    FRLegMiddle = new ModelRenderer(this, 73, 54);
    FRLegMiddle.addBox(-2F, 0F, -2.5F, 4, 7, 5);
    FRLegMiddle.setRotationPoint(-3F, 1F, -8F);
    FRLegMiddle.setTextureSize(256, 128);
    FRLegMiddle.mirror = true;
    setRotation(FRLegMiddle, -0.0174533F, 0F, 0F);
    FRLegBottom = new ModelRenderer(this, 98, 66);
    FRLegBottom.addBox(-1.5F, 0F, -1.5F, 3, 16, 3);
    FRLegBottom.setRotationPoint(-3F, 7F, -8F);
    FRLegBottom.setTextureSize(256, 128);
    FRLegBottom.mirror = true;
    setRotation(FRLegBottom, 0F, 0F, 0F);
    FRHoof = new ModelRenderer(this, 96, 88);
    FRHoof.addBox(-2F, 0F, -2F, 4, 2, 4);
    FRHoof.setRotationPoint(-3F, 22F, -8F);
    FRHoof.setTextureSize(256, 128);
    FRHoof.mirror = true;
    setRotation(FRHoof, 0F, 0F, 0F);
    FLLegTop.mirror = true;
    FLLegTop = new ModelRenderer(this, 94, 34);
    FLLegTop.addBox(-2.5F, 0F, -5.3F, 5, 10, 6);
    FLLegTop.setRotationPoint(3.2F, -8F, -5.5F);
    FLLegTop.setTextureSize(256, 128);
    FLLegTop.mirror = true;
    setRotation(FLLegTop, -0.0349066F, 0F, 0F);
    FLLegTop.mirror = false;
    FLLegMiddle = new ModelRenderer(this, 73, 54);
    FLLegMiddle.addBox(-2F, 0F, -2.5F, 4, 7, 5);
    FLLegMiddle.setRotationPoint(3F, 1F, -8F);
    FLLegMiddle.setTextureSize(256, 128);
    FLLegMiddle.mirror = true;
    setRotation(FLLegMiddle, -0.0174533F, 0F, 0F);
    FLLegBottom = new ModelRenderer(this, 98, 66);
    FLLegBottom.addBox(-1.5F, 0F, -1.5F, 3, 16, 3);
    FLLegBottom.setRotationPoint(3F, 8F, -8F);
    FLLegBottom.setTextureSize(256, 128);
    FLLegBottom.mirror = true;
    setRotation(FLLegBottom, 0F, 0F, 0F);
    FLHoof = new ModelRenderer(this, 96, 88);
    FLHoof.addBox(-2F, 0F, -2F, 4, 2, 4);
    FLHoof.setRotationPoint(3F, 22F, -8F);
    FLHoof.setTextureSize(256, 128);
    FLHoof.mirror = true;
    setRotation(FLHoof, 0F, 0F, 0F);
    BRLegTop.mirror = true;
    BRLegTop = new ModelRenderer(this, 94, 34);
    BRLegTop.addBox(-3F, 0F, 0F, 5, 9, 6);
    BRLegTop.setRotationPoint(-3F, -7F, 7.5F);
    BRLegTop.setTextureSize(256, 128);
    BRLegTop.mirror = true;
    setRotation(BRLegTop, -0.0371786F, 0F, 0F);
    BRLegTop.mirror = false;
    BRLegMiddle = new ModelRenderer(this, 96, 54);
    BRLegMiddle.addBox(-2F, 0F, -2F, 4, 7, 4);
    BRLegMiddle.setRotationPoint(-3.5F, 0.5F, 10F);
    BRLegMiddle.setTextureSize(256, 128);
    BRLegMiddle.mirror = true;
    setRotation(BRLegMiddle, 0.0743572F, 0F, 0F);
    BRLegBottom.mirror = true;
    BRLegBottom = new ModelRenderer(this, 98, 66);
    BRLegBottom.addBox(-1.5F, 0F, -1.5F, 3, 16, 3);
    BRLegBottom.setRotationPoint(-3.5F, 7F, 10.5F);
    BRLegBottom.setTextureSize(256, 128);
    BRLegBottom.mirror = true;
    setRotation(BRLegBottom, 0F, 0F, 0F);
    BRLegBottom.mirror = false;
    BRHoof = new ModelRenderer(this, 96, 88);
    BRHoof.addBox(-2F, 0F, -2F, 4, 2, 4);
    BRHoof.setRotationPoint(-3.5F, 22F, 10.5F);
    BRHoof.setTextureSize(256, 128);
    BRHoof.mirror = true;
    setRotation(BRHoof, 0F, 0F, 0F);
    BLLegTop = new ModelRenderer(this, 94, 34);
    BLLegTop.addBox(-3F, 0F, 0F, 5, 9, 6);
    BLLegTop.setRotationPoint(4F, -7F, 7.5F);
    BLLegTop.setTextureSize(256, 128);
    BLLegTop.mirror = true;
    setRotation(BLLegTop, -0.0371786F, 0F, 0F);
    BLLegMiddle = new ModelRenderer(this, 96, 54);
    BLLegMiddle.addBox(-2F, 0F, -2F, 4, 7, 4);
    BLLegMiddle.setRotationPoint(3.5F, 0.5F, 10F);
    BLLegMiddle.setTextureSize(256, 128);
    BLLegMiddle.mirror = true;
    setRotation(BLLegMiddle, 0.0743572F, 0F, 0F);
    BLLegBottom = new ModelRenderer(this, 98, 66);
    BLLegBottom.addBox(-1.5F, 0F, -1.5F, 3, 16, 3);
    BLLegBottom.setRotationPoint(3.5F, 7F, 10.5F);
    BLLegBottom.setTextureSize(256, 128);
    BLLegBottom.mirror = true;
    setRotation(BLLegBottom, 0F, 0F, 0F);
    BLHoof = new ModelRenderer(this, 96, 88);
    BLHoof.addBox(-2.5F, 0F, -2F, 4, 2, 4);
    BLHoof.setRotationPoint(4F, 22F, 10.5F);
    BLHoof.setTextureSize(256, 128);
    BLHoof.mirror = true;
    setRotation(BLHoof, 0F, 0F, 0F);
    TailTop = new ModelRenderer(this, 170, 4);
    TailTop.addBox(-0.5F, 0F, 0F, 1, 10, 1);
    TailTop.setRotationPoint(0F, -6.5F, 12.5F);
    TailTop.setTextureSize(256, 128);
    TailTop.mirror = true;
    setRotation(TailTop, 0.1115358F, 0F, 0F);
    TailBottom = new ModelRenderer(this, 166, 18);
    TailBottom.addBox(-1.5F, 0F, -1.5F, 3, 5, 3);
    TailBottom.setRotationPoint(0F, 3F, 14F);
    TailBottom.setTextureSize(256, 128);
    TailBottom.mirror = true;
    setRotation(TailBottom, 0F, 0F, 0F);
    }

    public void render(Entity entity, float time, float movementSpeed, float par4, float headAngleY, float headAngleX, float par7)
    {
    this.setRotationAngles(time, movementSpeed, par4, headAngleY, headAngleX, par7);

    if (this.isChild)
    {
    float childScaleFactor = 0.5F;
    GL11.glPushMatrix();
    GL11.glScalef(1.0F * childScaleFactor, 1.0F * childScaleFactor, 1.0F
    * childScaleFactor);
    GL11.glTranslatef(0.0F, 24.0F * par7, 0.0F);
    Shoulder.render(par7);
    ManeShoulder.render(par7);
    Neck1.render(par7);
    ManeNeck1.render(par7);
    Neck2.render(par7);
    ManeNeck2.render(par7);
    Neck3.render(par7);
    ManeNeck3.render(par7);
    Head.render(par7);
    ManeHead.render(par7);
    MuzzleTop.render(par7);
    MuzzleMiddle.render(par7);
    MuzzleMouth.render(par7);
    HeadTop.render(par7);
    StumpR.render(par7);
    StumpL.render(par7);
    EarR.render(par7);
    EarL.render(par7);
    Back.render(par7);
    Belly.render(par7);
    FRLegTop.render(par7);
    FRLegMiddle.render(par7);
    FRLegBottom.render(par7);
    FRHoof.render(par7);
    FLLegTop.render(par7);
    FLLegMiddle.render(par7);
    FLLegBottom.render(par7);
    FLHoof.render(par7);
    BRLegTop.render(par7);
    BRLegMiddle.render(par7);
    BRLegBottom.render(par7);
    BRHoof.render(par7);
    BLLegTop.render(par7);
    BLLegMiddle.render(par7);
    BLLegBottom.render(par7);
    BLHoof.render(par7);
    TailTop.render(par7);
    TailBottom.render(par7);

    GL11.glPopMatrix();

    }

    Shoulder.render(par7);
    ManeShoulder.render(par7);
    Neck1.render(par7);
    ManeNeck1.render(par7);
    Neck2.render(par7);
    ManeNeck2.render(par7);
    Neck3.render(par7);
    ManeNeck3.render(par7);
    Head.render(par7);
    ManeHead.render(par7);
    MuzzleTop.render(par7);
    MuzzleMiddle.render(par7);
    MuzzleMouth.render(par7);
    HeadTop.render(par7);
    StumpR.render(par7);
    StumpL.render(par7);
    EarR.render(par7);
    EarL.render(par7);
    Back.render(par7);
    Belly.render(par7);
    FRLegTop.render(par7);
    FRLegMiddle.render(par7);
    FRLegBottom.render(par7);
    FRHoof.render(par7);
    FLLegTop.render(par7);
    FLLegMiddle.render(par7);
    FLLegBottom.render(par7);
    FLHoof.render(par7);
    BRLegTop.render(par7);
    BRLegMiddle.render(par7);
    BRLegBottom.render(par7);
    BRHoof.render(par7);
    BLLegTop.render(par7);
    BLLegMiddle.render(par7);
    BLLegBottom.render(par7);
    BLHoof.render(par7);
    TailTop.render(par7);
    TailBottom.render(par7);
    }

    private void setRotation(ModelRenderer model, float x, float y, float z)
    {
    model.rotateAngleX = x;
    model.rotateAngleY = y;
    model.rotateAngleZ = z;
    }

    public void setRotationAngles(float time, float movementSpeed, float par4, float headAngleY, float headAngleX, float par7)
    {
    super.setRotationAngles(time, movementSpeed, par4, headAngleY, headAngleX, par7, null);
    //Leg/walking animation
    //WILL BE REPLACED WITH ANIMATION
    //Look at player animation and move
    this.Head.rotateAngleX = headAngleX / (180F / (float)Math.PI);
    this.Head.rotateAngleY = headAngleY / (180F / (float)Math.PI);
    this.Back.rotateAngleX = ((float)Math.PI);

    }

    }



    package com.hatchnegg.mymod.entities.giraffe;

    import com.hatchnegg.mymod.Main;
    import net.minecraft.client.renderer.entity.RenderLiving;
    import net.minecraft.entity.Entity;
    import net.minecraft.util.ResourceLocation;

    public class RenderGiraffe extends RenderLiving {

    private static final ResourceLocation textureLocation = new ResourceLocation(Main.MODID + ":" + "textures/entities/giraffe.png");

    public RenderGiraffe(ModelGiraffe model, float shadowSize) {
    super(model, shadowSize);
    }

    @Override
    protected ResourceLocation getEntityTexture(Entity par1Entity)
    {
    return textureLocation;
    }
    }



    Yes, the ModelGiraffe does not have any Child parts...I was going to fix that once I tested to see if this worked. The mod ID is "mymod", the name of the main class "Main", if that's useful information.


    Please Help!!!!!!!

    Posted in: Modification Development
  • 0

    posted a message on Animation for my mobs (other than simple like moving legs and head to walk and look at player)

    I have looked at Jabelar's tutorial on that, but he doesn't do much explaining on how this works:


    protected static final double CYCLES_PER_BLOCK = 3.0D; 
    protected int cycleIndex = 0;
    protected float[][] undulationCycle = new float[][]
    {
    { 45F, -45F, -45F, 0F, 45F, 45F, 0F, -45F },
    { 0F, 45F, -45F, -45F, 0F, 45F, 45F, 0F },
    { -45F, 90F, 0F, -45F, -45F, 0F, 45F, 45F },
    { -45F, 45F, 45F, 0F, -45F, -45F, 0F, 45F },
    { 0F, -45F, 45F, 45F, 0F, -45F, -45F, 0F },
    { 45F, -90F, 0F, 45F, 45F, 0F, -45F, -45F },
    };


    Like what XYZ each number stands for and how this works.


    More code in which he uses the above:


    @Override
    public void setRotationAngles(float parTime, float parSwingSuppress, float par3, float parHeadAngleY, float parHeadAngleX, float par6, Entity parEntity)
    {
    // animate if moving
    updateDistanceMovedTotal(parEntity);
    cycleIndex = (int) ((getDistanceMovedTotal(parEntity)*CYCLES_PER_BLOCK)%undulationCycle.length);
    body2.rotateAngleY = degToRad(undulationCycle[cycleIndex][0]) ;
    body3.rotateAngleY = degToRad(undulationCycle[cycleIndex][1]) ;
    body4.rotateAngleY = degToRad(undulationCycle[cycleIndex][2]) ;
    body5.rotateAngleY = degToRad(undulationCycle[cycleIndex][3]) ;
    body6.rotateAngleY = degToRad(undulationCycle[cycleIndex][4]) ;
    body7.rotateAngleY = degToRad(undulationCycle[cycleIndex][5]) ;
    body8.rotateAngleY = degToRad(undulationCycle[cycleIndex][6]) ;
    body9.rotateAngleY = degToRad(undulationCycle[cycleIndex][7]) ;
    }


    Help please (I'm such a noob)

    Posted in: Modification Development
  • 0

    posted a message on Animation for my mobs (other than simple like moving legs and head to walk and look at player)

    Hi!

    I know how to do basic animation for my mobs, like having the mob look at the player or have the legs move. But I want my mob to occasionally flick it's tail, make a small chewing motion, and on another mob have an animation that has it tail ripple whenever it walks. I've looked at Jabelar's tutorials and about everything I can think of but no tutorials are clear enough...they usually just show examples or show them typing something. Could someone please help? I'm a little bit of a noob in this area.

    Posted in: Modification Development
  • To post a comment, please or register a new account.