Jump to content

Recommended Posts

Posted

Alright so I am new to the modding community and I am wondering what I need to do to add a fuel!

Here is my code for my Item Class It is near the bottom:

 

 

package korcraft;

 

import net.minecraft.src.Item;

import net.minecraft.src.ItemStack;

import net.minecraft.src.ModLoader;

import net.minecraft.src.TileEntityFurnace;

public class ItemClass extends Item {

 

protected ItemClass(int par1) {

super(par1);

}

public String getTextureFile(){

return "/KorCraftTextures/Items.png";

}

        public int getItemBurnTime(ItemStack itemstack){

 

int i = itemstack.getItem().shiftedIndex;

 

if(i == KorCraftBase.FireCoal.shiftedIndex){

return 16000;//1600 per coal and 3200 for volcanite clump

}else

if(i == KorCraftBase.VolcaniteClump.shiftedIndex){

return 3200;//800 per volcanite shard

}else

if(i == KorCraftBase.VolcaniteShard.shiftedIndex){

return 800;//800 for a volcanite shard

}else

return 0;

}

 

                Alright, so my problem is that it is not registering my items as a fuel when I put it in a furnace. If you have any advice please email me @ [email protected]

}

 

The Korecraft Mod

Posted

You should make a class which implements IFuelHandler, then do the same thing as you're doing in your item class, then register is using cpw.mods.fml.common.registry.GameRegistry.registerFuelHandler.

Posted

Alright, thanks that did work and I am now in my 0.0.1.1012B stage (working fuels and stuff) next step is 0.0.1.2000A(working elemental picks!)(Oh god for the coding on that... need to add a new enchantment without occupying the slot for enchantment!)

The Korecraft Mod

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.