Jump to content

Recommended Posts

Posted

Something like with the crafting handler where you can search through each item on the entire list of fuels and remove ones by Item.name or Block.name

 

Like this

static void removeRecipesWithResult(ItemStack resultItem)
    {
        ArrayList recipes = (ArrayList) CraftingManager.getInstance().getRecipeList();

        for (int scan = 0; scan < recipes.size(); scan++)
        {
            IRecipe tmpRecipe = (IRecipe) recipes.get(scan);
            if (ItemStack.areItemStacksEqual(resultItem, tmpRecipe.getRecipeOutput()))
            {
                recipes.remove(scan);
            }//if
        }//for
    }//removeRecipesWithResult

 

but with these changes:

 

static void removeFuelsWithResult(ItemStack Fuel)
    {
        ArrayList fuels = (ArrayList) FuelManager.getInstance().getFuelHandlerList();

        for (int scan = 0; scan < fuels.size(); scan++)
        {
            IFuelHandler tmpFuel = (IFuelHandler) fuels.get(scan);
            if (ItemStack.areItemStacksEqual(fuel, tmpFuel.getItemStack()))
            {
                fuels.remove(scan);
            }//if
        }//for
    }//removeRecipesWithResult

 

 

With this addition, the IFuelHandler would also have ".getFuelTime()"

Posted

private static void removeFuelHandlerWithResult(ItemStack resultItem)
    {
        Map fuels = FurnaceRecipes.smelting().getSmeltingList();
        Map test = (Map) fuels.get(resultItem); 
        if (test != null)
        {
        	fuels.remove(test);
        }//if
    }//removeRecipesWithResult

 

Why doesn't this work then, am I missing something?

Guest
This topic is now closed to further replies.

Announcements



×
×
  • Create New...

Important Information

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