MC Modding
Please register and join the community!

How to make fuel

View previous topic View next topic Go down

How to make fuel

Post by viktorjanpaulis on 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

View user profile

Back to top Go down

Re: How to make fuel

Post by mastereric on 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
avatar
mastereric
Member

Posts : 30
Join date : 2011-10-26

View user profile

Back to top Go down

Re: How to make fuel

Post by ikke009 on 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?
avatar
ikke009
Member

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

View user profile

Back to top Go down

How to make fuel

Post by viktorjanpaulis on 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

View user profile

Back to top Go down

Re: How to make fuel

Post by ikke009 on 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
avatar
ikke009
Member

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

View user profile

Back to top Go down

Re: How to make fuel

Post by BobTehCodar on 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

View user profile

Back to top Go down

Re: How to make fuel

Post by ikke009 on 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?
avatar
ikke009
Member

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

View user profile

Back to top Go down

Re: How to make fuel

Post by BobTehCodar on 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

View user profile

Back to top Go down

Re: How to make fuel

Post by ikke009 on 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;
    }
avatar
ikke009
Member

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

View user profile

Back to top Go down

Re: How to make fuel

Post by Sponsored content


Sponsored content


Back to top Go down

View previous topic View next topic Back to top


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