Tutorial 7: Custom Fuels

In this tutorial I will be showing you how to make a custom fuel source.  Let's begin!

Create a new class and call it something along the lines of ModFuels. This is where we are going to be adding the fuels.
In this class we need to implement IFuelHandler and Override the getBurnTime method.
@SuppressWarnings("deprecation")
public class ModFuels implements IFuelHandler
{
      @Override
      public int getBurnTime(ItemStack fuel)
      {
          return 0;
      }
}
Now we need to add an if statement to check the Item/Block, Like so:
@Override
public int getBurnTime(ItemStack fuel)
{
      if(fuel.getItem() == Item.getItemFromBlock(BlockInit.TUTORIAL_BLOCK))
      {
            //The amount of ticks it will burn for
            return 16000;
      }
      if(fuel.getItem() == ItemInit.TUTORIAL_ITEM)
      {
            return 16000;
      }
      return 0;
}
As shown in the example above I added two if statements to show how it would be different for a block and an item.
Now we need to register this class in our FMLInitializationEvent This could be in one of 2 places, if you've been following this tutorial to every word then it will be in our Main class under init:
@SuppressWarnings("deprecation")
@EventHandler
public static void init(FMLInitializationEvent event)
{
    GameRegistry.registerFuelHandler(new ModFuels());
}

Finally we're finished!  Thank you for following this tutorial, and remember to look out for the next one!
- Mr. Pineapple