Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 4 of 4

Thread: Java need help!

  1. #1
    Junior Member
    Join Date
    Sep 2011
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Java need some help

    I am currently making a mod for a game called minecraft and i have recently run into an error which is this
    src\minecraft\net\minecraft\src\mod_sausagecooked. java:12: AddSmelting(int,net.minecraft.src.ItemStack)in net.minecraft.src.ModLoader cannot be applied to (net.minecraft.src.Item,net.miencraft.src.ItemStac k)
    ModLoader.AddSmelting(mod_sausafe.itemsausage, new ItemStack (itemsausagecooked, 1));
    This is the bit of code were that error occured please tell me what i need to fix
    package net.minecraft.src;
    import java.util.Random;

    public class mod_sausagecooked extends BaseMod
    {
    public static final Item itemsausagecooked = new ItemSausageCooked(2010).setItemName("asdflollpol") ;

    public mod_sausagecooked()
    {
    itemsausagecooked.iconIndex = ModLoader.addOverride("/gui/items.png", "/BritishFoods/sausagecooked.png");
    ModLoader.AddName(itemsausagecooked, "Cooked Sausage");
    ModLoader.AddSmelting(mod_sausage.itemsausage, new ItemStack (itemsausagecooked, 1));

    }

    public String Version()
    {
    return "3.14159265";
    }
    }
    Thank you help would be very much appreciated
    Last edited by offdacliffgaming; September 1st, 2011 at 07:07 AM.


  2. #2
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    SW Missouri
    Posts
    20,317
    Thanks
    49
    Thanked 2,191 Times in 2,164 Posts

    Default Re: Java need help!

    AddSmelting(int, net.minecraft.src.ItemStack)
    in net.minecraft.src.ModLoader
    cannot be applied to (net.minecraft.src.Item, net.miencraft.src.ItemStack)
    ModLoader.
    AddSmelting(mod_sausafe.itemsausage, new ItemStack (itemsausagecooked, 1));
    It looks like the parameters you are passing to the method do NOT match what the compiler wants you to pass to the method.
    The top line has: int as the first arg
    the bottom line has: mod_sausafe.itemsausage

  3. #3
    Junior Member
    Join Date
    Sep 2011
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Java need help!

    what do i need to do to fix it

  4. #4
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    SW Missouri
    Posts
    20,317
    Thanks
    49
    Thanked 2,191 Times in 2,164 Posts

    Default Re: Java need help!

    what do i need to do to fix it
    Change how you are calling the method to use the same datatypes as the method requires.
    Or overload the method to use the datatypes that you want to give it.

Tags for this Thread