ZidMC
Would you like to react to this message? Create an account in a few clicks or log in to continue.

mcdMobs -- errors need help!!! [Unanswered]

4 posters

Go down

mcdMobs -- errors need help!!! [Unanswered] Empty mcdMobs -- errors need help!!! [Unanswered]

Post by madcrazydrumma Sun May 01, 2011 12:33 pm

Hi guys

i need help with my mcdMobs mod...

i have an error with my first mob...

here is the error :
Code:

MCP 2.12 running in /Users/madcrazydrumma/Desktop/mcp212_test1
Compiling Minecraft
sources/minecraft/net/minecraft/src/mod_Warthog.java:12: cannot find symbol
symbol  : variable Modloader
location: class net.minecraft.src.mod_Warthog
Modloader.getUniqueEntityID());
^
sources/minecraft/net/minecraft/src/mod_Warthog.java:20: cannot find symbol
symbol  : constructor RenderWarthog(net.minecraft.src.ModelWarthog,float)
location: class net.minecraft.src.RenderWarthog
      map.put(EntityWarthog.class, new RenderWarthog(new ModelWarthog(),
                                  ^
2 errors

and here is my RenderWarthog :
Code:

package net.minecraft.src;

public class RenderWarthog extends RenderLiving
{

    public RenderWarthog(ModelBase modelbase, ModelBase modelbase1, float f)
    {
        super(modelbase, f);
        setRenderPassModel(modelbase1);
    }

    protected boolean renderSaddledPig(EntityWarthog entitywarthog, int i, float f)
    {
        loadTexture("/mob/saddle.png");
        return i == 0 && entitywarthog.getSaddled();
    }

    protected boolean shouldRenderPass(EntityLiving entityliving, int i, float f)
    {
        return renderSaddledPig((EntityWarthog)entityliving, i, f);
    }
}

and here is my mod_Warthog :
Code:

package net.minecraft.src;

public class EntityWarthog extends EntityAnimal
{

    public EntityWarthog(World world)
    {
        super(world);
        texture = "/mob/warthog.png";
        setSize(0.9F, 0.9F);
    }

    protected void entityInit()
    {
        dataWatcher.addObject(16, Byte.valueOf((byte)0));
    }

    public void writeEntityToNBT(NBTTagCompound nbttagcompound)
    {
        super.writeEntityToNBT(nbttagcompound);
        nbttagcompound.setBoolean("Saddle", getSaddled());
    }

    public void readEntityFromNBT(NBTTagCompound nbttagcompound)
    {
        super.readEntityFromNBT(nbttagcompound);
        setSaddled(nbttagcompound.getBoolean("Saddle"));
    }

    protected String getLivingSound()
    {
        return "mob.pig";
    }

    protected String getHurtSound()
    {
        return "mob.pig";
    }

    protected String getDeathSound()
    {
        return "mob.pigdeath";
    }

    public boolean interact(EntityPlayer entityplayer)
    {
        if(getSaddled() && !worldObj.multiplayerWorld && (riddenByEntity == null || riddenByEntity == entityplayer))
        {
            entityplayer.mountEntity(this);
            return true;
        } else
        {
            return false;
        }
    }

    protected int getDropItemId()
    {
        if(fire > 0)
        {
            return Item.porkCooked.shiftedIndex;
        } else
        {
            return Item.porkRaw.shiftedIndex;
        }
    }

    public boolean getSaddled()
    {
        return (dataWatcher.getWatchableObjectByte(16) & 1) != 0;
    }

    public void setSaddled(boolean flag)
    {
        if(flag)
        {
            dataWatcher.updateObject(16, Byte.valueOf((byte)1));
        } else
        {
            dataWatcher.updateObject(16, Byte.valueOf((byte)0));
        }
    }

    public void func_27014_a(EntityLightningBolt entitylightningbolt)
    {
        EntityWarthog entitywarthog = new EntityWarthog(worldObj);
        entitywarthog.setLocationAndAngles(posX, posY, posZ, rotationYaw, rotationPitch);
        worldObj.entityJoinedWorld(entitywarthog);
        setEntityDead();
    }

    protected void fall(float f)
    {
        super.fall(f);
        if(f > 5F && (riddenByEntity instanceof EntityPlayer))
        {
            ((EntityPlayer)riddenByEntity).func_27026_a(AchievementList.field_27375_u);
        }
    }
}

Please help... :L

madcrazydrumma
ZidMC Coder
ZidMC Coder

Posts : 61
Join date : 2011-04-22
Age : 28
Location : Dubai

Back to top Go down

mcdMobs -- errors need help!!! [Unanswered] Empty Re: mcdMobs -- errors need help!!! [Unanswered]

Post by shoopdawhoop23 Sun May 01, 2011 12:35 pm

For the first error, the L in ModLoader isn't capitalized. See if that clears up the other one.

shoopdawhoop23
Moderator
Moderator

Posts : 56
Join date : 2011-04-22

Back to top Go down

mcdMobs -- errors need help!!! [Unanswered] Empty Re: mcdMobs -- errors need help!!! [Unanswered]

Post by madcrazydrumma Mon May 02, 2011 8:53 am

No it doesnt clear it up... im still having an error Here is the error:
Code:


MCP 2.12 running in /Users/madcrazydrumma/Desktop/mcp212_test1
Compiling Minecraft
sources/minecraft/net/minecraft/src/mod_Warthog.java:12: cannot find symbol
symbol  : method getUniqueEntityID()
location: class net.minecraft.src.ModLoader
ModLoader.getUniqueEntityID());
        ^
sources/minecraft/net/minecraft/src/mod_Warthog.java:20: cannot find symbol
symbol  : constructor RenderWarthog(net.minecraft.src.ModelWarthog,float)
location: class net.minecraft.src.RenderWarthog
      map.put(EntityWarthog.class, new RenderWarthog(new ModelWarthog(),
                                  ^
2 errors
*** minecraft_server.jar not found, skipping
=== MCP 2.12 recompile script finished ===

and the 2 classes are above... i have no idea what is wrong?! :L

madcrazydrumma
ZidMC Coder
ZidMC Coder

Posts : 61
Join date : 2011-04-22
Age : 28
Location : Dubai

Back to top Go down

mcdMobs -- errors need help!!! [Unanswered] Empty Re: mcdMobs -- errors need help!!! [Unanswered]

Post by Byronyello Mon May 02, 2011 9:54 am

Hey, don't just copy and paste code and rename it. Also, Java is looking for a Constructor. MCP says, learn the basics and come back to us. You should know what Constructors are. I don't know about the other error, your code seems okay there.
Byronyello
Byronyello
Iron Miner

Posts : 28
Join date : 2011-04-27
Age : 27
Location : Keighley, West Yorkshire, England!

http://byronyello.newgrounds.com

Back to top Go down

mcdMobs -- errors need help!!! [Unanswered] Empty Re: mcdMobs -- errors need help!!! [Unanswered]

Post by madcrazydrumma Mon May 02, 2011 10:02 am

Hmm well if someone could help that would be useful

RE: "The the new error log is above and also my files are at the top post aswell"...

madcrazydrumma
ZidMC Coder
ZidMC Coder

Posts : 61
Join date : 2011-04-22
Age : 28
Location : Dubai

Back to top Go down

mcdMobs -- errors need help!!! [Unanswered] Empty Re: mcdMobs -- errors need help!!! [Unanswered]

Post by xMinecraft45 Mon May 02, 2011 10:06 am

I know what is wrong. Your mod_Warthog is wrong.

It says:
Code:
public class EntityWarthog extends EntityAnimal

It should say:
Code:
public class mod_Warthog extends BaseMod

Thats the only thing I saw wrong. If it doesn't work I don't know what to do.

xMinecraft45
Recruit

Posts : 1
Join date : 2011-05-02

Back to top Go down

mcdMobs -- errors need help!!! [Unanswered] Empty Re: mcdMobs -- errors need help!!! [Unanswered]

Post by madcrazydrumma Mon May 02, 2011 10:27 am

Ok Will Try that now and i will post again to see if it helped Smile

madcrazydrumma
ZidMC Coder
ZidMC Coder

Posts : 61
Join date : 2011-04-22
Age : 28
Location : Dubai

Back to top Go down

mcdMobs -- errors need help!!! [Unanswered] Empty Re: mcdMobs -- errors need help!!! [Unanswered]

Post by madcrazydrumma Mon May 02, 2011 10:34 am

Oops lol... at the above i accidentaly posted my entity as the mod_Warthog.java file...

anyways here is all my class files plus the error log ...

Error Log:
Code:

MCP 2.12 running in /Users/madcrazydrumma/Desktop/mcp212_test1
Compiling Minecraft
sources/minecraft/net/minecraft/src/mod_Warthog.java:12: cannot find symbol
symbol  : method getUniqueEntityID()
location: class net.minecraft.src.ModLoader
ModLoader.getUniqueEntityID());
        ^
sources/minecraft/net/minecraft/src/mod_Warthog.java:20: cannot find symbol
symbol  : constructor RenderWarthog(net.minecraft.src.ModelWarthog,float)
location: class net.minecraft.src.RenderWarthog
      map.put(EntityWarthog.class, new RenderWarthog(new ModelWarthog(),
                                  ^
2 errors
*** minecraft_server.jar not found, skipping
=== MCP 2.12 recompile script finished ===

and here is my RenderWarthog :
Code:

package net.minecraft.src;

public class RenderWarthog extends RenderLiving
{

    public RenderWarthog(ModelBase modelbase, ModelBase modelbase1, float f)
    {
        super(modelbase, f);
        setRenderPassModel(modelbase1);
    }

    protected boolean renderSaddledPig(EntityWarthog entitywarthog, int i, float f)
    {
        loadTexture("/mob/saddle.png");
        return i == 0 && entitywarthog.getSaddled();
    }

    protected boolean shouldRenderPass(EntityLiving entityliving, int i, float f)
    {
        return renderSaddledPig((EntityWarthog)entityliving, i, f);
    }
}

and here is my mod_Warthog :
Code:
package net.minecraft.src;

import java.util.*;
import java.util.Map;

public class mod_Warthog extends BaseMod
{

   public mod_Warthog()
   {
   ModLoader.RegisterEntityID(EntityWarthog.class, "WartHog",
ModLoader.getUniqueEntityID());

   ModLoader.AddSpawn(EntityWarthog.class, 2,
EnumCreatureType.creature);
   }
   
   public void AddRenderer(Map map)
   {
      map.put(EntityWarthog.class, new RenderWarthog(new ModelWarthog(),
0.5F));
   }
   
   public String Version()
   {
      return "mcdMobs for Beta 1.5_01!";
   }
   
}

and here is my EntityWarthog :
Code:
package net.minecraft.src;

public class EntityWarthog extends EntityAnimal
{

    public EntityWarthog(World world)
    {
        super(world);
        texture = "/mob/warthog.png";
        setSize(0.9F, 0.9F);
    }

    protected void entityInit()
    {
        dataWatcher.addObject(16, Byte.valueOf((byte)0));
    }

    public void writeEntityToNBT(NBTTagCompound nbttagcompound)
    {
        super.writeEntityToNBT(nbttagcompound);
        nbttagcompound.setBoolean("Saddle", getSaddled());
    }

    public void readEntityFromNBT(NBTTagCompound nbttagcompound)
    {
        super.readEntityFromNBT(nbttagcompound);
        setSaddled(nbttagcompound.getBoolean("Saddle"));
    }

    protected String getLivingSound()
    {
        return "mob.pig";
    }

    protected String getHurtSound()
    {
        return "mob.pig";
    }

    protected String getDeathSound()
    {
        return "mob.pigdeath";
    }

    public boolean interact(EntityPlayer entityplayer)
    {
        if(getSaddled() && !worldObj.multiplayerWorld && (riddenByEntity == null || riddenByEntity == entityplayer))
        {
            entityplayer.mountEntity(this);
            return true;
        } else
        {
            return false;
        }
    }

    protected int getDropItemId()
    {
        if(fire > 0)
        {
            return Item.porkCooked.shiftedIndex;
        } else
        {
            return Item.porkRaw.shiftedIndex;
        }
    }

    public boolean getSaddled()
    {
        return (dataWatcher.getWatchableObjectByte(16) & 1) != 0;
    }

    public void setSaddled(boolean flag)
    {
        if(flag)
        {
            dataWatcher.updateObject(16, Byte.valueOf((byte)1));
        } else
        {
            dataWatcher.updateObject(16, Byte.valueOf((byte)0));
        }
    }

    public void func_27014_a(EntityLightningBolt entitylightningbolt)
    {
        EntityWarthog entitywarthog = new EntityWarthog(worldObj);
        entitywarthog.setLocationAndAngles(posX, posY, posZ, rotationYaw, rotationPitch);
        worldObj.entityJoinedWorld(entitywarthog);
        setEntityDead();
    }

    protected void fall(float f)
    {
        super.fall(f);
        if(f > 5F && (riddenByEntity instanceof EntityPlayer))
        {
            ((EntityPlayer)riddenByEntity).func_27026_a(AchievementList.field_27375_u);
        }
    }
}

and finally here is my modelWarthog :
Code:
package net.minecraft.src;

public class ModelWarthog extends ModelQuadruped
{

    public ModelWarthog()
    {
        super(6, 0.0F);
    }

    public ModelWarthog(float f)
    {
        super(6, f);
    }
}

and basically for the modelWarthog i just copied and pasted the codes from the pig.java files in the sources part of MCP...

so yeh please help :L

madcrazydrumma
ZidMC Coder
ZidMC Coder

Posts : 61
Join date : 2011-04-22
Age : 28
Location : Dubai

Back to top Go down

mcdMobs -- errors need help!!! [Unanswered] Empty Re: mcdMobs -- errors need help!!! [Unanswered]

Post by Sponsored content


Sponsored content


Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum