Biomes O' Plenty

Biomes O' Plenty

151M Downloads

Willow saplings - not fuel

Syndaryl opened this issue ยท 2 comments

commented

Willow saplings don't appear to be registered as fuel, and I have some suspicion they aren't registered in the Ore Dictionary as a sapling synonym for other mods to use; if you're working in a swampy biome, this can get frustrating. 4 stacks of saplings just sitting around in my chest...

commented

Just ran through all the saplings, and none of the BoP saplings are registered as fuel.

commented

Tracked down the problem after pulling the sourcecode, but I have no idea how to submit a patch in Git.

in FurnaceFuelHandler, getFuelValue only considers an exact match of metadata and your dictionary key. However, saplings, and various other things, are registered only under the default of a metadata of 0. Anything other than whatever the kind of sapling that has a metadata of 0 won't match, and can't get pulled.

I tested the following replacement getFuelValue and it fixed the issue for me:

private static int getFuelValue(ItemStack stack)
{
    Pair<Item, Integer> pair = Pair.of(stack.getItem(), stack.getItemDamage());

    if (fuelList.containsKey(pair))
    {
        return fuelList.get(pair);
    }
    else
    {
        pair = Pair.of(stack.getItem(), 0);
        if (fuelList.containsKey(pair))
        {
            return fuelList.get(pair);
        }
    }

    return 0;
}