MC Modding
Please register and join the community!


Join the forum, it's quick and easy

MC Modding
Please register and join the community!
MC Modding
Would you like to react to this message? Create an account in a few clicks or log in to continue.

How to make fuel

4 posters

Go down

How to make fuel Empty How to make fuel

Post by viktorjanpaulis Thu Oct 27, 2011 1:06 am

Well you make a fuel compatible with modloader first make the item/block (not tried it on block, so not sure) and then in the mod_* put this code in.

Code:

   public int AddFuel(int i, int j)
    {
            if(i == <Block/Item here>)
            { 
                    return <How long, coal is 1600>;
            }
            return 0;
    }

bassically public in AddFuel tells that it's making a fuel, simple. the int i stands for what the thing is and int j is how long it burns for. and the return 0 is so the item deletes after its done, if you delete that it will be infinite.


Hope this help.

viktorjanpaulis
Member

Posts : 2
Join date : 2011-10-26

Back to top Go down

How to make fuel Empty Re: How to make fuel

Post by mastereric Thu Oct 27, 2011 2:31 am

Just to help people a little: this means that an item that smelts for 200 can smelt one item before the flame goes out. Nice Tut BTW Very Happy
mastereric
mastereric
Member

Posts : 30
Join date : 2011-10-26

Back to top Go down

How to make fuel Empty Re: How to make fuel

Post by ikke009 Thu Oct 27, 2011 10:45 am

Thanksalot Smile
Also is it possible to change the ammount of coal required for an item to smelt, instead of lets say 1/8 coal for 1 iron, 1/2 coal for 1 iron?
ikke009
ikke009
Member

Posts : 65
Join date : 2011-10-24
Age : 29
Location : The netherlands

Back to top Go down

How to make fuel Empty How to make fuel

Post by viktorjanpaulis Thu Oct 27, 2011 10:57 am

ikke009 wrote:Thanksalot Smile
Also is it possible to change the ammount of coal required for an item to smelt, instead of lets say 1/8 coal for 1 iron, 1/2 coal for 1 iron?

i think so... you just need to get your numbers right.

go into GOOGLE and type in 'minecraf furnace' then is says something like crafting furnace wiki click on that and scroll down to basic recipes and you'll see there..
I can't leave link cause i registered less than 7 days ago.

viktorjanpaulis
Member

Posts : 2
Join date : 2011-10-26

Back to top Go down

How to make fuel Empty Re: How to make fuel

Post by ikke009 Thu Oct 27, 2011 11:18 am

Code:
 public int AddFuel(int i, int j)
  {
      if(i == mod_jasper.browncoalbit.shiftedIndex)
      {
              return 2400;
      }
      return 0;
}

Why does this not work? i put it in my mod_jasper outside of any {} thingys

nvm it works fine Smile
ikke009
ikke009
Member

Posts : 65
Join date : 2011-10-24
Age : 29
Location : The netherlands

Back to top Go down

How to make fuel Empty Re: How to make fuel

Post by BobTehCodar Fri Oct 28, 2011 11:53 pm

I can't get this to work: I removed
Code:
return 0;
and it gives me an error on
Code:
public int AddFuel(int i, int j)
Halp please?

BobTehCodar
Member

Posts : 3
Join date : 2011-10-28

Back to top Go down

How to make fuel Empty Re: How to make fuel

Post by ikke009 Fri Oct 28, 2011 11:58 pm

try deleting int j so it will be
public int AddFuel(int i)

not sure if that would work but worth a try no?
ikke009
ikke009
Member

Posts : 65
Join date : 2011-10-24
Age : 29
Location : The netherlands

Back to top Go down

How to make fuel Empty Re: How to make fuel

Post by BobTehCodar Sat Oct 29, 2011 12:04 am

ikke009 wrote:try deleting int j so it will be
public int AddFuel(int i)

not sure if that would work but worth a try no?
I still get an error D:

BobTehCodar
Member

Posts : 3
Join date : 2011-10-28

Back to top Go down

How to make fuel Empty Re: How to make fuel

Post by ikke009 Sat Oct 29, 2011 6:46 pm

im just going to make another guess since nobody else is responding..
try making the code like this
Code:

 public int AddFuel(int i, int j)
    {
            if(i == <Block/Item here>)
            {
                    return -1;
            }
            return 0;
    }
ikke009
ikke009
Member

Posts : 65
Join date : 2011-10-24
Age : 29
Location : The netherlands

Back to top Go down

How to make fuel Empty Re: How to make fuel

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